How to select a given number of elements from the dimension?

Post Reply
VV_VV
Posts: 6
Joined: Wed Oct 14, 2015 1:49 am
OLAP Product: Planning Analytics
Version: 2.0...
Excel Version: 2016

How to select a given number of elements from the dimension?

Post by VV_VV »

Hello,

I have a line item dimension with the elements from 1 to 100. I'd like to give a user an ability to select the first 5, 10, ext. elements on the websheet. The dimension is used in the allocation cube, so one value can be allocated to three line items or five, or fifteen. The number should be flexible. I know about TOPCOUNT function, but it's based on the values, which is not what I need. Is there an MDX function that can be applied to the dimension subset to select as many elements as needed?
declanr
MVP
Posts: 1815
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: How to select a given number of elements from the dimension?

Post by declanr »

You want to use the HEAD function in MDX:

https://docs.microsoft.com/en-us/sql/md ... rver-ver15
Declan Rodger
User avatar
20 Ton Squirrel
Posts: 71
Joined: Tue Jul 14, 2020 9:53 pm
OLAP Product: TM1
Version: Planning Analytics with Watson
Excel Version: Office 365
Location: Houston, TX

Re: How to select a given number of elements from the dimension?

Post by 20 Ton Squirrel »

You could also set up a number of subsets beforehand, just name each subset according to their selection. A TI process could do a one-time automation of that tedium.

Declan's response is far more efficient, though, I must admit. ;)
War teaches us geography, getting old teaches us biology.
Post Reply