Skip to Content
0
Former Member
Mar 20, 2009 at 05:01 PM

MDX Expression for TOPN condition in Universe

66 Views

Hello,

I want to replicate the TOP(N) condition from the BEx query in my universe, so that I can use this to build my QWAAS query ( to be used later in an Xcelsius model to display top 20 customers).

I got my MDX statement working using the following syntax,

Step 1:

Created a new calculated expression,

<EXPRESSION>

Rank([0DEBITOR].CurrentMember,

Order([0DEBITOR].CurrentMember.Level.Members, [Measures].[4D52K2M4THSLZN44EESUNFZGE], @Prompt('Top','N',{'BDESC'},mono,constrained,,{'BDESC'})))

</EXPRESSION>

and created a Filter for the above expression,

<FILTER EXPRESSION = "Rank( [0DEBITOR].CurrentMember,

Order([0DEBITOR].CurrentMember.Level.Members,

[Measures].[4D52K2M4THSLZN44EESUNFZGE],

@Prompt('Top','N',{'BDESC'},mono,constrained,,{'BDESC'}) ) ) ">

<CONDITION OPERATORCONDITION="LessOrEqual">

<CONSTANT CAPTION="@Prompt('Enter value for Top/Bottom N','N',,mono,free)"/></CONDITION></FILTER>

The integrity check for the Universe was ok.

But when I try to create a QWAAS query, the query times out.

I run my QWAAS query for DEBITOR, the new RANKED Expression, for a given key date.

Is there something I am missing?

Any help would be greatly appreciated.

Thanks,

Bindu.