MDX statement for pointing to a subset

Post Reply
Adam
Posts: 97
Joined: Wed Apr 03, 2019 12:10 am
OLAP Product: IBM PA
Version: 2.0.9.x
Excel Version: Microsoft 365 x64

MDX statement for pointing to a subset

Post by Adam »

When writing a view MDX statement inclusive of a subset, what is the preferred syntax to use?

Is it:

(A) [Dimension].[Hierarchy].[Set]
-or-
(B) TM1SubsetToSet([Dimension].[Hierarchy], 'Subset')?

Option (A) is more succinct, but TM1 tends to "auto generate" (B), hence my question.
Take care.
Adam
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: MDX statement for pointing to a subset

Post by declanr »

99% of the time they will be exactly the same results.
However, if you had an element and subset with the same name - it would return the element instead of the subset... so using SubsetToSet makes sure that it returns the subset.

It’s probably good practice to be as explicit as possible of what you want as you may not have any elements and subsets with the same names now but in the future things might change and you may overlook the impact of it in this case.
Declan Rodger
Post Reply