MDX (Hear the Shudders)

Post Reply
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

MDX (Hear the Shudders)

Post by jim wood »

Guys,

If I have one area of weakness it is MDX. I've never really spent much time with it. Normally I use record in the subset editor but this doesn't work for what I'm trying to do.

What I am trying to do is create an mdx subset within TI. I need to pass the MDX a consolidation name and use the MDX to create a subset containing all the level 0 elements for that consolidation. Could anybody help me out with this?

Many Thanks,

Jim.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: MDX (Hear the Shudders)

Post by tomok »

If you are creating the subset in TI then you need to use the SubsetCreateByMDX function. You need to pass a string to that function that represents the MDX query you want to execute. What you want is the Descendants keyword. Like this:

{TM1FILTERBYLEVEL({DESCENDANTS(Dimension.[YourConsolidatedNode]) }, 0)}
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
lotsaram
MVP
Posts: 3706
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: MDX (Hear the Shudders)

Post by lotsaram »

jim wood wrote:Guys,

If I have one area of weakness it is MDX. I've never really spent much time with it. Normally I use record in the subset editor but this doesn't work for what I'm trying to do.

What I am trying to do is create an mdx subset within TI. I need to pass the MDX a consolidation name and use the MDX to create a subset containing all the level 0 elements for that consolidation. Could anybody help me out with this?

Many Thanks,

Jim.
Jim the subset editor MDX recorder will work perfectly well for this.
{TM1FILTERBYLEVEL( {TM1DRILLDOWNMEMBER( {TM1SubsetBasis()}, ALL, RECURSIVE )}, 0)}
Just replace TM1SubsetBasis() with [dimension].[consolidation]
E.g.
sSub = 'mySub';
sDim = 'myDim';
sHier = 'myConsol';
sMDX = '{TM1FILTERBYLEVEL( {TM1DRILLDOWNMEMBER( {[' | sDim | '].[' | sHier | ']}, ALL, RECURSIVE )}, 0)}';
SubsetCreateByMDX(sSub, sMDX);

MDX is pretty powerful, especially with active forms and despite the quirkiness of TM1's implementation of it. If you haven't gotten at least a little up to speed then its high time you started.
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: MDX (Hear the Shudders)

Post by jim wood »

Thanks for the responses guys.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Post Reply