dbTalk Databases Forums  

Using MDX to find an average for leaf members on rows...dynamically

comp.databases.olap comp.databases.olap


Discuss Using MDX to find an average for leaf members on rows...dynamically in the comp.databases.olap forum.



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

Default Using MDX to find an average for leaf members on rows...dynamically - 01-14-2004 , 03:54 PM






I am trying to find the average number of products of the set that is
on rows...dynamically.

For example, if I had states on rows and was looking at the average
number of products, I would see this

IN 72
MI 66
AL 88

Using the code below, these numbers are found by taking the average of
the number of products of the children of the members of the current
level of the current dimension. For example, the children of IN might
be Indianapolis (number products 73) and Evansville (number products
71)..and the average of these two cities' number of products is 72:


avg(Dimensions(StrToSet("Head(Axis(1))").Item(0).I tem(StrToSet("Head(Axis(1))").Item(0).Count
- 1).Dimension.Name).CurrentMember.Children, [Measures].[Number
Products])

That works great. However, what if you are at the leaf level? For
example, what if I select multiple members of the township level of
the location dimension? If I select Barr Township and LaCrosse
Township from the long list of townships of Indianapolis, and put that
on rows...what if I want to see the average of those 2 townships? For
example, when looking at the value of the number of products I see:

Barr Township 22
LaCrosse Township 44

Then when I am looking at the average number of products I want to see
this:

Barr Township 33
LaCrosee Township 33

How can I do this with MDX?

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.