TM1 TOPCOUNT MDX query not working

Post Reply
wigglyrat
Posts: 67
Joined: Wed Sep 02, 2015 3:09 pm
OLAP Product: TM1
Version: 10_2_2
Excel Version: 2010

TM1 TOPCOUNT MDX query not working

Post by wigglyrat »

Hi:

I am working to create an MDX query in that brings back the top 10 'BDE's'. The details are as follows

Cube: zz BDE
Dimension: zz BDE (this is the dimension where I want the top 10 from)
Measure: Gross Net Written Premium (this is in a dimension called 'zz Measures')

So far I have tried

Code: Select all

{TOPCOUNT({TM1FILTERBYLEVEL( {TM1SUBSETALL( [zz BDE] )}, 0)}, 10, [zz BDE].([zz Measures].[Gross Net Written Premium]))} 
But this does not return any results.

Can anyone please clarify which fields go into the last part of this formula to pull back this info?

Many thanks in advance.
Edward Stuart
Community Contributor
Posts: 248
Joined: Tue Nov 01, 2011 10:31 am
OLAP Product: TM1
Version: All
Excel Version: All
Location: Manchester
Contact:

Re: TM1 TOPCOUNT MDX query not working

Post by Edward Stuart »

The MDX Primer is your friend and it can be found here:

http://bihints.com/book/export/html/68
A classic Top 10 command:
{ TOPCOUNT( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [Product] )}, 0)}, 10, [Test].([Posting Measures].[Amount]) )}
By omitting a sort order it sorts in the default order (which has the values descending in value and breaks any hierarchies present).
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: TM1 TOPCOUNT MDX query not working

Post by lotsaram »

I doubt your cube has only the BDE and measure dimension! You need to specify the element at each dimension other than the one being sorted on.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Post Reply