MDX Query : Subset vs 2 Dimensions

Post Reply
User avatar
Steve Rowe
Site Admin
Posts: 2464
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

MDX Query : Subset vs 2 Dimensions

Post by Steve Rowe »

Hi,

I'm building a source view for a data transfer between a detailed to summary cube. The dimensions in the destination / summary cube are related subsets of the source / detailed cube.

I hold some flags in a cube to say if the detailed elements should be in the summary cube but these includes all the consolidated ones too.

So what I want to do is a piece of MDX like this

Code: Select all

{INTERSECT (
{FILTER({TM1FILTERBYLEVEL( {TM1SUBSETALL( [DetailedDim] )},[sys-BIDefn_DetailedDim].
     ([BI_Cube_Name].[BI_Cube_1],[BI_Cube_Measure].[Element Inclusion]) = "1")} ,
{TM1FILTERBYLEVEL( {TM1SUBSETALL( [SummaryDim] )}, 0)}
)}
i.e all the flagged elements that are N level in the summary dimension.

This isn't valid syntax however as I can't directly reference two different dimensions (I think) and I get an error
INTERSECT: Sets have incompatible dimensionality expression:
from the TI process.

I can easily add another measure to my flagging cube that folds the level 0 test in and reference this, except I have to do it in many places. So there are plenty of ways of me to solve my actual problem. Just want to know if this is a basic limitation of MDX or if I am missing something?

Cheers,
Technical Director
www.infocat.co.uk
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: MDX Query : Subset vs 2 Dimensions

Post by Wim Gielis »

Hello Steve

Most probably not related to your question, but don't you miss the 2nd parameter in the TM1FILTERBYLEVEL() function ?

Wim
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
User avatar
Martin Ryan
Site Admin
Posts: 2003
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: MDX Query : Subset vs 2 Dimensions

Post by Martin Ryan »

My MDX is not fantastic but from what I can work out this isn't possible. I think the closest you'll get is using StrToMember, but I can't see how to make that apply to multiple elements.

I'd expect you can find much easier ways of handling this, like doing some dimix's and ellev's in the prolog of the TI process that moves the data across. A static subset will also be faster as MDX will be continually re-evaluated.
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
User avatar
Steve Rowe
Site Admin
Posts: 2464
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: MDX Query : Subset vs 2 Dimensions

Post by Steve Rowe »

Yes thanks Martin,

The whole constant reevaluation of MDX thing is a real pain, really limits its use in process.

I can already build the subs manually but I just wanted to try some other methods since it was taking a long time to loop through all the dimensions.

Once I have the MDX right I can use that to build the static subsets I need.

Cheers,
Technical Director
www.infocat.co.uk
Post Reply