dbTalk Databases Forums  

MDX: Retrieving the sum for all time up to a member property value

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


Discuss MDX: Retrieving the sum for all time up to a member property value in the microsoft.public.sqlserver.olap forum.



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

Default MDX: Retrieving the sum for all time up to a member property value - 08-30-2005 , 03:48 PM






I need to create a calculated measure that sums all of the activity(minutes)
in my cube from the first date in the ActivityDate dimension until a given
time for example

8/16/2001

I'm using the following MDX :
SUM(PeriodsToDate([ActivityDate].[Std].[(All)] ,[ActivityDate].[Std].[Year
Number].[2001].&[24008].&[20010816]),[Measures].[Activity Minutes])

The problem is that I need to replace the hardcoded 8/16/2001 with the value
of a member property in the term dimension

I can do this using this mdx expression:
[Term].[Std].CurrentMember.Properties("TermAccessDateValue")

I'm having trouble putting the two pieces together I need to somehow convert
a string to the coresponding member in the ActivityDate Dimension

There seems like the must be a more elagant solution

Any ideas?

Reply With Quote
  #2  
Old   
Jason
 
Posts: n/a

Default RE: MDX: Retrieving the sum for all time up to a member property value - 09-01-2005 , 02:55 PM






I worked this out using two calculated measures the first simply subtotals
the values:

SUM
(
PeriodsToDate
(
[ActivityDate].[Std].[(All)]
,strToMember
(
"[ActivityDate].[Std].&[" +
Cstr([Term].[Std].CurrentMember.Properties("TermAccessDateValue")) +"]"
)

)
,[Measures].[Activity Minutes]
)


The second performs the aggregations so that it rolls up nicly

SUM(Descendants([Term].[Std].CurrentMember,[Term Name]),[Measures].[Term
Access Minutes Sub Total])


This has caused performance to tank, I think this is due to having two
calculated measures for each snapshot.

I would like to be able to do this with a single calculated measure; but
this is just out of the grasp of my MDX skill level

any advice for refactoring this?


"Jason" wrote:

Quote:
I need to create a calculated measure that sums all of the activity(minutes)
in my cube from the first date in the ActivityDate dimension until a given
time for example

8/16/2001

I'm using the following MDX :
SUM(PeriodsToDate([ActivityDate].[Std].[(All)] ,[ActivityDate].[Std].[Year
Number].[2001].&[24008].&[20010816]),[Measures].[Activity Minutes])

The problem is that I need to replace the hardcoded 8/16/2001 with the value
of a member property in the term dimension

I can do this using this mdx expression:
[Term].[Std].CurrentMember.Properties("TermAccessDateValue")

I'm having trouble putting the two pieces together I need to somehow convert
a string to the coresponding member in the ActivityDate Dimension

There seems like the must be a more elagant solution

Any ideas?

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.