dbTalk Databases Forums  

MDX Rollup Formula

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


Discuss MDX Rollup Formula in the microsoft.public.sqlserver.olap forum.



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

Default MDX Rollup Formula - 06-21-2005 , 07:42 AM






logic:
iif(measure.name = "headcount",Avg(Date.CurrentMember.Children
),Sum(Date.CurrentMember.Children ))

I need to get the name of the measure. If it is the same as stated in the
logical expr then week date should average, else sum.

HELP!

Reply With Quote
  #2  
Old   
OLAPMonkey (http://olapmonkey.blogspot.com/)
 
Posts: n/a

Default Re: MDX Rollup Formula - 06-21-2005 , 11:43 AM






Measure.CurrentMember.Name


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

Default Re: MDX Rollup Formula - 06-21-2005 , 10:01 PM



Am still getting an error when I do this:
IIF(Measure.CurrentMember.Name =
"no_of_workers",Avg(Date.CurrentMember.Children),S um(Date.CurrentMember.Children))

The error I get is: Formula error - syntax error - token is not valid:
"IIF(^Measure^.CurrentMember.Name =
"no_of_workers",Avg(Date.CurrentMember.Children),S um(Date.CurrentMember.Children))"

HELP!

"OLAPMonkey (http://olapmonkey.blogspot.c" wrote:

Quote:
Measure.CurrentMember.Name



Reply With Quote
  #4  
Old   
misheL
 
Posts: n/a

Default Re: MDX Rollup Formula - 06-22-2005 , 05:02 AM



what is wrong with my mdx?
iif(isempty(Measures.Members("Number Of CSAs"),
Avg(Date.CurrentMember.Children) , Sum(Date.CurrentMember.Children))

"misheL" wrote:

Quote:
Am still getting an error when I do this:
IIF(Measure.CurrentMember.Name =
"no_of_workers",Avg(Date.CurrentMember.Children),S um(Date.CurrentMember.Children))

The error I get is: Formula error - syntax error - token is not valid:
"IIF(^Measure^.CurrentMember.Name =
"no_of_workers",Avg(Date.CurrentMember.Children),S um(Date.CurrentMember.Children))"

HELP!

"OLAPMonkey (http://olapmonkey.blogspot.c" wrote:

Measure.CurrentMember.Name



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

Default Re: MDX Rollup Formula - 06-22-2005 , 08:11 PM



Try:

Quote:
IIF([Measures].CurrentMember
is [Measures].[no_of_workers],
Avg(Date.CurrentMember.Children),
Sum(Date.CurrentMember.Children))
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


Reply With Quote
  #6  
Old   
misheL
 
Posts: n/a

Default Re: MDX Rollup Formula - 06-22-2005 , 10:42 PM



thanks much!


"Deepak Puri" wrote:

Quote:
Try:


IIF([Measures].CurrentMember
is [Measures].[no_of_workers],
Avg(Date.CurrentMember.Children),
Sum(Date.CurrentMember.Children))



- 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.