Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sorting needed in MDX with Topcount and NON Empty Filter

6 views
Skip to first unread message

rupni...@gmail.com

unread,
Nov 9, 2009, 5:14:11 AM11/9/09
to
Hi,

Can any one help me with sorting the data year wise for below MDX
without much changing the MDX
means that data should be displayed yearwise.....that is first for
2002, then 2003, then 2004..in this order...


SELECT NON EMPTY {TopCount({Crossjoin({[Measures].[Reseller Sales
Amount]},{[Geography].[Geography].[(All)].AllMembers})},20,[Measures].
[Reseller Sales Amount])} ON COLUMNS,
NON EMPTY {TopCount({[Delivery Date].[Fiscal].[All Periods].Children},
20,[Measures].[Reseller Sales Amount])} ON ROWS
FROM "Adventure Works"

the below query which doesn't use any filter and topcount works
fine...and gives sorted data year wise...

SELECT {Crossjoin({[Measures].[Reseller Sales Amount]},{[Geography].
[Geography].[(All)].AllMembers})} ON COLUMNS,
{[Delivery Date].[Fiscal].[All Periods].Children} ON ROWS
FROM "Adventure Works"


is it possible to make the first query show the data in datewise
order? Any help is highly appreciated.

Best Regards,
Rupesh

amish

unread,
Nov 9, 2009, 8:01:36 AM11/9/09
to
On Nov 9, 3:14 pm, "rupnice...@gmail.com" <rupnice...@gmail.com>
wrote:

Try this

SELECT NON EMPTY {TopCount({Crossjoin({[Measures].[Reseller Sales
Amount]},{[Geography].[Geography].[(All)].AllMembers})},20,[Measures].
[Reseller Sales Amount])} ON COLUMNS,

non empty(hierarchize ( {TopCount({[Delivery Date].[Fiscal].[All
Periods].Children},
40,[Measures].[Reseller Sales Amount])} ))ON ROWS
FROM [Adventure Works]

Amish Shah
http://shahamishm.blogspot.com

0 new messages