Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Analysis Services (2000)
 Count Per Group

Author  Topic 

Hyukevain
Yak Posting Veteran

66 Posts

Posted - 2004-08-16 : 00:39:07
Hai,

I develop OLAP Cube with sereval dimensions in it.
One of my dimension have Standard structure with name [Agent Dimension], and have sereval level.
Here the true hierachy structure of my dimension
Dim Name [Agent Dimension]
Level : . = [Region]
.. = [Branch]
...= [Agent]

I need to create a Calculated Member that count total [Agent] for every [Branch].

Can anybody help me solve this problem by giving me some MDX Query sample ?

Thank's
Mike

griva
Starting Member

7 Posts

Posted - 2004-08-16 : 15:34:53



iif([Agent Dimension].currentmember.level.name="Branch" , [Agent Dimension].currentmember.children.count, 0)
Go to Top of Page

Hyukevain
Yak Posting Veteran

66 Posts

Posted - 2004-08-17 : 22:23:38
Thank's for your help, it work !!

Can I have a little advice again ?

I use that calculate member to make average total production Agent for every branch.
Now, my problem is, I have the other dimension Product. I can create a calculate member like the above for average total product for every package (average product per package).
Can I make only 1 calculate Member to show all the average depend on which dimension use ?

How to detect dimension level with empty measure ? Because I want to set the value to 1 when the measure is not empty and 0 when empty.

Thank's for your advice, I really needed it.
Go to Top of Page
   

- Advertisement -