dbTalk Databases Forums  

Multiple Time Values in Same MDX, AS2005

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


Discuss Multiple Time Values in Same MDX, AS2005 in the microsoft.public.sqlserver.olap forum.



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

Default Multiple Time Values in Same MDX, AS2005 - 07-07-2006 , 05:22 AM






OK,

I have a time dimension and I have my measures. What I want to do is to
be able to query the values for the current time, current day, and
current month in the same MDX

For example if I wanted the value for the current time I would craft
the following MDX

select [Customer].Children on rows,
{ [Measures].[MinValue], [Measures].[SuccessRate] } on columns
from [Cube]
where [Time].[2006].[Quarter 3].[July].[6].[11].[30]

and for hour it would be

.....
where [Time].[2006].[Quarter 3].[July].[6].[11]

and so on down to just having the day value as

.....
where [Time].[2006].[Quarter 3].[July]

Fairly easy so far!!

Question is .... can I craft this into one MDX query, so that I would
get a result set something like

customer1 m1_time_value m1_day_value m1_month_val m2_tim_value
.........
customer2 m1_time_value m1_day_value m1_month_val m2_tim_value
.........

I have tried going down the filter route

ie m1_time_value would be filter( [Measure].[1], [Time].[2006].[Quarter
3].[July].[6].[11].[30] ) and m1_day_value would be filter(
[Measure].[1], [Time].[2006].[Quarter 3].[July].[6] )

but that doesn't seem to work..

Anyone any ideas please??

Cheers

Bob


Reply With Quote
  #2  
Old   
Tim Dot NoSpam
 
Posts: n/a

Default Re: Multiple Time Values in Same MDX, AS2005 - 07-07-2006 , 11:32 PM






You could probably use custom members to do this if you're talking about the
same time hierarchy.

Select based on the lowest grain (current time) and extract the parents to
derive the values for the day,week, month, quatrter, year, etc.

-Tim

"Bob Bain" <bobjbain (AT) gmail (DOT) com> wrote

Quote:
OK,

I have a time dimension and I have my measures. What I want to do is to
be able to query the values for the current time, current day, and
current month in the same MDX

For example if I wanted the value for the current time I would craft
the following MDX

select [Customer].Children on rows,
{ [Measures].[MinValue], [Measures].[SuccessRate] } on columns
from [Cube]
where [Time].[2006].[Quarter 3].[July].[6].[11].[30]

and for hour it would be

....
where [Time].[2006].[Quarter 3].[July].[6].[11]

and so on down to just having the day value as

....
where [Time].[2006].[Quarter 3].[July]

Fairly easy so far!!

Question is .... can I craft this into one MDX query, so that I would
get a result set something like

customer1 m1_time_value m1_day_value m1_month_val m2_tim_value
........
customer2 m1_time_value m1_day_value m1_month_val m2_tim_value
........

I have tried going down the filter route

ie m1_time_value would be filter( [Measure].[1], [Time].[2006].[Quarter
3].[July].[6].[11].[30] ) and m1_day_value would be filter(
[Measure].[1], [Time].[2006].[Quarter 3].[July].[6] )

but that doesn't seem to work..

Anyone any ideas please??

Cheers

Bob




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.