MDX expession

Post Reply
Analytics123
Posts: 128
Joined: Tue May 23, 2017 12:45 pm
OLAP Product: Tm1
Version: 9.5
Excel Version: 2010

MDX expession

Post by Analytics123 »

I have the below mdx to select the 3 items in level 3

{TM1FILTERBYLEVEL({TM1DRILLDOWNMEMBER({[Items].[All Teams].[50].[50 - 5].[50 - 5 - 406],[Items].[All Teams].[50].[50 - 5].[50 - 5 - 407],[Items].[All Teams].[50].[50 - 5].[50 - 5 - 409]}, ALL, RECURSIVE )}, 3)}


now i need modify the mdx to choose 2 items from level 3 and one item from level 4


50-5-406, 50-5-407, 50-5-409-010

In the above mdx i filter by level 3 , since all a re level 3 , now i have level 3 and level 4 how do i change the mdx .
ascheevel
Community Contributor
Posts: 286
Joined: Fri Feb 15, 2013 5:49 pm
OLAP Product: TM1
Version: PA 2.0.9.1
Excel Version: 365
Location: Minneapolis, USA

Re: MDX expession

Post by ascheevel »

UNION should work
Wim Gielis
MVP
Posts: 3105
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: MDX expession

Post by Wim Gielis »

Analytics123 wrote: Wed Oct 18, 2017 3:22 pm I have the below mdx to select the 3 items in level 3

{TM1FILTERBYLEVEL({TM1DRILLDOWNMEMBER({[Items].[All Teams].[50].[50 - 5].[50 - 5 - 406],[Items].[All Teams].[50].[50 - 5].[50 - 5 - 407],[Items].[All Teams].[50].[50 - 5].[50 - 5 - 409]}, ALL, RECURSIVE )}, 3)}
Why do you include the full path to the elements in the MDX code ? Elements in a dimension are unique, no ?
Best regards,

Wim Gielis

IBM Champion 2024
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
macsir
MVP
Posts: 782
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: MDX expession

Post by macsir »

{TM1FILTERBYLEVEL({TM1DRILLDOWNMEMBER({[Items].[All Teams].[50].[50 - 5].[50 - 5 - 406],[Items].[All Teams].[50].[50 - 5].[50 - 5 - 407]}, ALL, RECURSIVE )}, 3)} + {TM1FILTERBYLEVEL({TM1DRILLDOWNMEMBER({[Items].[All Teams].[50].[50 - 5].[50 - 5 - 409]}, ALL, RECURSIVE )}, 4)}
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
Post Reply