I am trying to think of an MDX that would give me all the top level elements of a dimension. I saw this discussion http://www.tm1forum.com/viewtopic.php?p=26127 which came to no real conclusion as to my problem. What I have in mind is the following:
{Head ( TM1SubsetAll ( [Clients] ) )} gives me the first top level element, the name of it is "All Client Groups".
{[Clients].[All Client Groups].Siblings} gives me all the elements which I want to see (i.e. all the top level elements and, yes, there are N-elements among them which is okay for me).
Now I tried something like this, but I failed: {[Clients].[{Head ( TM1SubsetAll ( [Clients] ) )}].Siblings}
To be precise: In my mind, top level elements are elements that have no parent. If someone can give me a solution for "Consolidated elements that have no parent" that would be fine as well in this case.
Regards
Holger
MDX to select top level elements
- Michel Zijlema
- Site Admin
- Posts: 712
- Joined: Wed May 14, 2008 5:22 am
- OLAP Product: TM1, PALO
- Version: both 2.5 and higher
- Excel Version: 2003-2007-2010
- Location: Netherlands
- Contact:
Re: MDX to select top level elements
Hi,
Maybe this is what you're looking for?:
Michel
EDIT: although I see that one is covered in the thread you referred to
Maybe this is what you're looking for?:
Code: Select all
{FILTER( {TM1SUBSETALL( [Clients] )}, [Clients].CurrentMember.Parent.Name="")}
EDIT: although I see that one is covered in the thread you referred to
-
- Posts: 74
- Joined: Thu Jun 17, 2010 10:35 am
- OLAP Product: TM1
- Version: 9.4 9.5.1
- Excel Version: 2003 - 2007
Re: MDX to select top level elements
Hi holger,
this should work:
{ FILTER(
{TM1SUBSETALL( [MyDim] )},
[MyDim].CurrentMember.Level.ordinal = 0
) }
level.ordinal refer to generation starting by 0.
this should work:
{ FILTER(
{TM1SUBSETALL( [MyDim] )},
[MyDim].CurrentMember.Level.ordinal = 0
) }
level.ordinal refer to generation starting by 0.
-
- MVP
- Posts: 3229
- 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 to select top level elements
Statements like that can be found on this page (direct link to my website):
http://users.skynet.be/fa436118/wim/tm1 ... nts_EN.htm
http://users.skynet.be/fa436118/wim/tm1 ... nts_EN.htm
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
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
-
- Posts: 131
- Joined: Tue May 17, 2011 10:04 am
- OLAP Product: TM1
- Version: Planning Analytics 2.0
- Excel Version: 2016
- Location: Freiburg, Germany
Re: MDX to select top level elements
Perfect! Thanks to all of you for your quick help.
Best regards
Holger
Best regards
Holger