![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I am using AS2005 and trying to get a distinct count using MDX where the sales is greater than 0. The Sales measure is Calc'd from 2 different measure groups (2 fact tables). It's quite easy to do using this example which i ripped from another post. WITH MEMBER [MEASURES].[CalcCount] AS 'COUNT(FILTER(CROSSJOIN({[Measures].[GrossPot]}, DESCENDANTS ([Outlet].[by Territory].CURRENTMEMBER, [Outlet].[by Territory].[Outlet])),[Measures].[GrossPot]>0))' SELECT {[Measures].[GrossPot], [MEASURES].[CalcCount] } ON COLUMNS, [Outlet].[by Territory].CHILDREN ON ROWS FROM [MyCube] This works great, BUT the problem is that I have multiple hierarchies in the Outlet dimension (3 in total), so if i switch the Rows to "[Outlet].[by Channel].CHILDREN ON ROWS" the result for each Channel child is simply the total count of outlets that have GrossPot > 0. I'm not sure if there is an example of this in the Adventure works. I hope this is clear enough so that someone can help me. Thanks, Ben |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Hi Jeje, Thanks for your answer, but your MDX gives me the exact same answers as before (albeit better performance most likely), but when i change to the alternate hierarchy on the rows, the answer is incorrect... for example Outlet by Territory (Which gives the correct answer) 101 20 102 25 103 30 Outlet by Channel (Which totals the above and displays for each measure) Department Stores 75 Newsagents 75 Discount Stores 75 There must be a way to get this to work across hierarchies. |
#5
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |