dbTalk Databases Forums  

Multiple Time Hierarchies Problem

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Multiple Time Hierarchies Problem in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Akber
 
Posts: n/a

Default Multiple Time Hierarchies Problem - 04-26-2005 , 10:41 AM






Hi,

I have developed two hierarchies for the time dimension. One for Calender
Year and the other for the fiscal year.

The problem is that in my cube I have created some calculated measures that
computes the projected sales in the selected time member level.
e.g. If the user is at month level then it calculates the
-days passed in that month
- sales in that month
- totaldays in that month
and then it displays the projected sales of that month.
Same is the case for Quarter and Year level.

The Question is that do I have to create sepratate set of calculated members
for each hierarchy.


--
Thanks
Akber.

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Multiple Time Hierarchies Problem - 04-26-2005 , 07:07 PM






If your users will only select a specific member from one of the 2 time
hierarchies, leaving the other hierarchy selection at the "All" level,
then you can check the level of the current member in each hierarchy.
Something like:

[Measures].[FiscalSelected] :
Quote:
([CalendarDate].CurrentMember.Level is [CalendarDate].[All])

[Measures].[TotalDays] :
Quote:
iif([Measures].[FiscalSelected],
Count(Descendants([FiscalDate].CurrentMember,
[FiscalDate].[Day])),
Count(Descendants([CalendarDate].CurrentMember,
[CalendarDate].[Day])))
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #3  
Old   
Akber
 
Posts: n/a

Default Re: Multiple Time Hierarchies Problem - 04-27-2005 , 02:12 AM



Thanks Deepak for the reply.

- My users can select any level of any of the two time dimension hierarchies
at a time. In that case what would be the solution because ur solution
assumes that the user is analyzing sales using only one hierarchy at a time.

--
Thanks
Akber.


"Deepak Puri" wrote:

Quote:
If your users will only select a specific member from one of the 2 time
hierarchies, leaving the other hierarchy selection at the "All" level,
then you can check the level of the current member in each hierarchy.
Something like:

[Measures].[FiscalSelected] :

([CalendarDate].CurrentMember.Level is [CalendarDate].[All])


[Measures].[TotalDays] :

iif([Measures].[FiscalSelected],
Count(Descendants([FiscalDate].CurrentMember,
[FiscalDate].[Day])),
Count(Descendants([CalendarDate].CurrentMember,
[CalendarDate].[Day])))



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #4  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Multiple Time Hierarchies Problem - 04-27-2005 , 10:41 AM



Hi Akber,


Since the 2 hierarchies aren't orthogonal, you have to define what
results should be returned when there are simultaneous selections on the
2 hierarchies. For example,
if Calendar Month and Fiscal Quarter are selected, then are projected
sales based on the month or the quarter? The 2 selections may even be
mutually exclusive. Once these kind of issues are resolved, then the MDX
can be considered.


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.