MDX expession

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

MDX expession

Post by Analytics123 » 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)}


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
Posts: 9
Joined: Fri Feb 15, 2013 5:49 pm
OLAP Product: TM1
Version: 11.2
Excel Version: 2016

Re: MDX expession

Post by ascheevel » Wed Oct 18, 2017 3:49 pm

UNION should work

Wim Gielis
MVP
Posts: 1562
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0
Excel Version: 2016
Location: Brussels, Belgium
Contact:

Re: MDX expession

Post by Wim Gielis » Fri Oct 20, 2017 3:30 am

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

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 104 TM1 articles and a lot of custom code
Newest blog article: Delete a cube and its dimensions

User avatar
macsir
Community Contributor
Posts: 446
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1, SSAS
Version: 9.5 - 10.2
Excel Version: 97 - 2013
Contact:

Re: MDX expession

Post by macsir » Tue Oct 24, 2017 4:51 am

{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