Groups | Blog | Home
all groups > sql server reporting services > may 2006 >

sql server reporting services : Incorrect measures by hiding a time dimension level


geert.tholen NO[at]SPAM gmail.com
5/24/2006 7:27:17 AM
Hello everyone,

I'm developing a report, based on an OLAP cube, that shows Budgets and
Costs.
As a report parameter i use Posting Period, which is a time dimension
with the levels Year, Quarter, Month, Date.
When you select a value for this parameter, the listbox shows the
folowing values:

All Posting Period
2000
Q3
September
01-09-2000
02-09-2000
....

Because the report user only wants to change values on a monthly level,
I would like to hide the "Date" level, because it gives too much
details. It should be something like this:

All Posting Period
2000
Q3
September
.....

The problem is that the measures become incorrect when I try to hide
this level.
I have tried to set it's visibility to "False" in the cube, i have
tried to create another dimension based on the same data, which shows
only the correct levels, and have been searching for an MDX formula to
filter the dimension levels. So far nothing has worked.

I would like to know whether it's possible to hide a certain dimension
level in the Reporting Services editor (VS.NET), or if anyone has a
solution to do this within the cube or with an MDX formula.

Thanks a lot!
Kaisa M. Lindahl Lervik
5/26/2006 1:59:26 PM
Depending on what your Month level looks like, you should be able to do
something like this:

descendants([Date].defaultmember, 2, self_and_before) - if Month is level 2.

This query will give you a hierarchied list over the first 3 levels of the
Date dimension, adding the Unique name and Key for each item. Change to fit
your solution:

with Member [Measures].[DateMemberUniqueName] as
'[Date].currentmember.UniqueName'
member [Measures].[DateDisplayName] as
'Space([Date].Currentmember.Level.Ordinal * 4) +
Date.Currentmember.Properties("Key")'

SELECT
{[Measures].[DateMemberUniqueName],[Measures].[DateDisplayName]} on Columns,
order (descendants([Date].defaultmember, 3, self_and_before),
[Date].currentmember.Name, desc) on rows
from
[Cube]

Kaisa M. Lindahl Lervik

[quoted text, click to view]

geert.tholen NO[at]SPAM gmail.com
5/29/2006 12:24:19 AM
Thank you very much for your reply!
By using your code, the measures remain correct when you select an
other period.
The only problem i have left, is that the All Level isn't shown
anymore.
Do you how I can solve this?

Thanks in advance!
geert.tholen NO[at]SPAM gmail.com
5/29/2006 6:43:49 AM
It seems the All Level was already shown, but it didn't have a label
set.
I solved this by using the IIF-function to check whether the label is
empty.
If it is, i set the label to "All Date".

Thanks for your help!
AddThis Social Bookmark Button