![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a query almost working SELECT { [Measures].[Sends] } on axis(0), Generate ( TopCount ([Zone Id].[Zone Id].Members,5, [Sends]), TopCount (Descendants({[Zone Id].CurrentMember}, 3),5,[Sends] ) ) on axis (1) FROM [Consumer] -------------------------------------------------- This is the data and levels of Ids. I need the top 5 Level1 Id's. And for each Level1 Id, I need the top 5 Level3 Id's. [Zone Id]->[Zone Id]->[Level1 Id]->[Level2 Id]->[Level3 Id] Right now I get the right data, but it sorts it according to the 'Zone Id' Giving me the top 5 Level3 Id's for Zone Id. I need 'Zone Id' to always be '14'. I tried to add FROM [Consumer] where [Zone Id].[14] but that didn't work. And I'm having problems going: TopCount ([Zone Id].[14].Members,5, [Sends]), TopCount ([Zone Id].[14].[Partner Id].Members,5, [Sends]), I get the name binding errors |
#3
| |||
| |||
|
|
And if I do this: I can't get the CurrentMember to be 'Level1 Id', I just get back 5 results cus the current member is always 14. SELECT { [Measures].[Sends] } on axis(0), Generate ( TopCount ({[Zone Id].[14]},5, [Sends]), TopCount ( Descendants({[Zone Id].CurrentMember}, 3),5,[Sends] ) ) on axis (1) FROM [Consumer] "Cindy Lee" <cindylee (AT) hotmail (DOT) com> wrote in message news:eCE8g%23ZeEHA.1656 (AT) TK2MSFTNGP09 (DOT) phx.gbl... I have a query almost working SELECT { [Measures].[Sends] } on axis(0), Generate ( TopCount ([Zone Id].[Zone Id].Members,5, [Sends]), TopCount (Descendants({[Zone Id].CurrentMember}, 3),5,[Sends] ) ) on axis (1) FROM [Consumer] -------------------------------------------------- This is the data and levels of Ids. I need the top 5 Level1 Id's. And for each Level1 Id, I need the top 5 Level3 Id's. [Zone Id]->[Zone Id]->[Level1 Id]->[Level2 Id]->[Level3 Id] Right now I get the right data, but it sorts it according to the 'Zone Id' Giving me the top 5 Level3 Id's for Zone Id. I need 'Zone Id' to always be '14'. I tried to add FROM [Consumer] where [Zone Id].[14] but that didn't work. And I'm having problems going: TopCount ([Zone Id].[14].Members,5, [Sends]), TopCount ([Zone Id].[14].[Partner Id].Members,5, [Sends]), I get the name binding errors |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
why not just change [Zone Id].[14] to [Zone Id].[14].MEMBERS... ================================================== ============== SELECT { [Measures].[Sends] } on axis(0), Generate ( TopCount ({[Zone Id].[14].MEMBERS},5, [Sends]), TopCount ( Descendants({[Zone Id].CurrentMember}, 3),5,[Sends] ) ) on axis (1) FROM [Consumer] I guess......that's what you are asking..... |
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |