Distinguish String elements in an MDX
-
- MVP
- Posts: 3120
- 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:
Distinguish String elements in an MDX
Hello all,
As the title of the topic says, does anyone know how to distinguish string elements from numeric elements in an MDX-statement ?
I would like to, for example, have an MDX-driven subset on a dimension, that filters out all lowest-level numeric elements - no string elements.
I checked the properties, CurrentMember and so on, but could not find anything useful. Maybe it's because TM1 does not expose this information in its application of MDX statements ?
Thanks !
As the title of the topic says, does anyone know how to distinguish string elements from numeric elements in an MDX-statement ?
I would like to, for example, have an MDX-driven subset on a dimension, that filters out all lowest-level numeric elements - no string elements.
I checked the properties, CurrentMember and so on, but could not find anything useful. Maybe it's because TM1 does not expose this information in its application of MDX statements ?
Thanks !
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
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
-
- MVP
- Posts: 1815
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: Distinguish String elements in an MDX
Not aware of any mdx filter function for it but I can't say I have ever tried; if there was a function I would assume it must be a TM1 specific function as opposed to standard MDX.
Suppose to get around it you could have a TI populate an attribute on the dim that just places the result of a DType in the attribute. Then filter that in the MDX.
Suppose to get around it you could have a TI populate an attribute on the dim that just places the result of a DType in the attribute. Then filter that in the MDX.
Declan Rodger
-
- MVP
- Posts: 3120
- 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: Distinguish String elements in an MDX
Thank you Declan. You confirm my findings.
The purpose is to only use MDX, such that the dynamic subset responds to changing dimension elements/hierarchies without running any additional TI process.
I would also like to avoid a rule with Dtype.
Thanks !
The purpose is to only use MDX, such that the dynamic subset responds to changing dimension elements/hierarchies without running any additional TI process.
I would also like to avoid a rule with Dtype.
Thanks !
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
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
- gtonkin
- MVP
- Posts: 1202
- Joined: Thu May 06, 2010 3:03 pm
- OLAP Product: TM1
- Version: Latest and greatest
- Excel Version: Office 365 64-bit
- Location: JHB, South Africa
- Contact:
Re: Distinguish String elements in an MDX
Hi Wim,
I generally ensure all my N and C measures have formats configured with comma, percentage etc. etc. The remaining measures would then generally be the strings.
I then use MDX as follows to select them:
Obviously not fool-proof but in your case I get the feeling you are meticulous so should work.
I generally ensure all my N and C measures have formats configured with comma, percentage etc. etc. The remaining measures would then generally be the strings.
I then use MDX as follows to select them:
Code: Select all
FILTER([Measures].Members, [Measures].Currentmember.Properties("Format") = "")
-
- MVP
- Posts: 3120
- 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: Distinguish String elements in an MDX
Hello gtonkin,
Thanks, it's 1 step in the good direction, I hadn't thought of that.
I'll be looking for other solutions and keep this one in mind.
Wim
Thanks, it's 1 step in the good direction, I hadn't thought of that.
I'll be looking for other solutions and keep this one in mind.
Wim
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
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
-
- MVP
- Posts: 3654
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Distinguish String elements in an MDX
Why don't you want to set an Attribute with DType?Wim Gielis wrote:Thank you Declan. You confirm my findings.
The purpose is to only use MDX, such that the dynamic subset responds to changing dimension elements/hierarchies without running any additional TI process.
I would also like to avoid a rule with Dtype.
Thanks !
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
-
- Community Contributor
- Posts: 152
- Joined: Tue Apr 02, 2013 1:41 pm
- OLAP Product: tm1, cognos bi
- Version: from TM1 9.4 to PA 2.0.9.6
- Excel Version: 2010
- Location: Toronto, ON
Re: Distinguish String elements in an MDX
I have done this with a Text Attribute Element_Type and in the TI that loads my measures dimension, I populate this attribute, but you can have a Rule to automatically maintain that attribute. Basically same this as lotsaram is proposing.
Ardian Alikaj
-
- MVP
- Posts: 3120
- 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: Distinguish String elements in an MDX
Hello all,
Thanks for the replies.
The scenario is as follows: I would like to use TI to create an MDX-driven subset to gather orphan elements.
I could do this in 1 dimension, or all dimensions of a certain cube, or all application dimensions, ...
I would prefer to only do the SubsetCreateByMDX and that's it. No additional attributes dimensions and cubes, no rules, and so on.
Whenever the dimension changes, the subset should update (as is usual with dynamic subsets ) without running the TI process again.
And by any chance... a method that is fool-proof
Wim
Thanks for the replies.
The scenario is as follows: I would like to use TI to create an MDX-driven subset to gather orphan elements.
I could do this in 1 dimension, or all dimensions of a certain cube, or all application dimensions, ...
I would prefer to only do the SubsetCreateByMDX and that's it. No additional attributes dimensions and cubes, no rules, and so on.
Whenever the dimension changes, the subset should update (as is usual with dynamic subsets ) without running the TI process again.
And by any chance... a method that is fool-proof
Wim
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
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
- gtonkin
- MVP
- Posts: 1202
- Joined: Thu May 06, 2010 3:03 pm
- OLAP Product: TM1
- Version: Latest and greatest
- Excel Version: Office 365 64-bit
- Location: JHB, South Africa
- Contact:
Re: Distinguish String elements in an MDX
Cannot do fool-proof but may have last resort for you as follows:
ORI have not been able to establish what, if any Property could be used to derive the DType and filter on Simple, Consolidated or String - may someone else has stumbled onto this and can share then you would have your solution.
Code: Select all
FILTER(
FILTER(
FILTER( [Measures].Members,
COUNT([Measures].CurrentMember.Ancestors)=0),
COUNT([Measures].CurrentMember.Children)=0),
[Measures].Currentmember.Properties("Format") <> "")
Code: Select all
FILTER(
FILTER(
FILTER( [Measures].Members,
[Measures].CurrentMember.Parent.Name=""),
COUNT([Measures].CurrentMember.Children)=0),
[Measures].Currentmember.Properties("Format") <> "")
-
- Community Contributor
- Posts: 152
- Joined: Tue Apr 02, 2013 1:41 pm
- OLAP Product: tm1, cognos bi
- Version: from TM1 9.4 to PA 2.0.9.6
- Excel Version: 2010
- Location: Toronto, ON
Re: Distinguish String elements in an MDX
By Orphan Elements you mean leaf numeric elements that do not have a parent? In that case you can write an MDX to do that, but if you want to distinguish String Elements from N elements that I dont think you can achieve it without additional attributes.Wim Gielis wrote:Hello all,
Thanks for the replies.
The scenario is as follows: I would like to use TI to create an MDX-driven subset to gather orphan elements.
I could do this in 1 dimension, or all dimensions of a certain cube, or all application dimensions, ...
I would prefer to only do the SubsetCreateByMDX and that's it. No additional attributes dimensions and cubes, no rules, and so on.
Whenever the dimension changes, the subset should update (as is usual with dynamic subsets ) without running the TI process again.
And by any chance... a method that is fool-proof
Wim
Ardian Alikaj
-
- MVP
- Posts: 3120
- 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: Distinguish String elements in an MDX
That's indeed the subject of this topicardi wrote:By Orphan Elements you mean leaf numeric elements that do not have a parent? In that case you can write an MDX to do that, but if you want to distinguish String Elements from N elements that I dont think you can achieve it without additional attributes.
I had hoped for a reliable MDX-way of separating n and s type elements.
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
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
-
- Posts: 13
- Joined: Mon Jun 03, 2013 8:45 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: None
Re: Distinguish String elements in an MDX
I might be missing something, but if the dimension had at least one cube that it was used in (as the format dimension), then an expression should demonstrate the strings like so:
EXCEPT({TM1SUBSETALL( [MyDim] )},{ FILTER( {TM1SUBSETALL( [MyDim] )}, [MyCube].[MyDim].CurrentMember<3.402823E38 AND [MyCube].[MyDim].CurrentMember>-3.402823E38)})
It doesn't matter if the cube is populated or not.
I haven't tested thoroughly, but it works in the small sample of cubes I've tried.
EXCEPT({TM1SUBSETALL( [MyDim] )},{ FILTER( {TM1SUBSETALL( [MyDim] )}, [MyCube].[MyDim].CurrentMember<3.402823E38 AND [MyCube].[MyDim].CurrentMember>-3.402823E38)})
It doesn't matter if the cube is populated or not.
I haven't tested thoroughly, but it works in the small sample of cubes I've tried.
-
- MVP
- Posts: 3120
- 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: Distinguish String elements in an MDX
And then George Tonkin came with the solution !
1 = N type
2 = S type
3 = C type
Code: Select all
Filter( TM1SubsetAll( [Revenue_Msr] ), [Revenue_Msr].CurrentMember.Properties("ELEMENT_TYPE")="1")
2 = S type
3 = C type
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
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
-
- Community Contributor
- Posts: 292
- Joined: Tue Sep 06, 2016 7:55 am
- OLAP Product: TM1
- Version: 10.1.1
- Excel Version: Excel 2010
Re: Distinguish String elements in an MDX
Talk about dogged persistence, an example to us all!
I was then wondering if Element_Weight would return anything but doesn't!
I did get Element_Index to work,
so for example,
regards,
Mark
I was then wondering if Element_Weight would return anything but doesn't!
I did get Element_Index to work,
so for example,
Code: Select all
Filter( TM1SubsetAll( [Revenue_Msr] ), [Revenue_Msr].CurrentMember.Properties("ELEMENT_INDEX")>"2")
Mark
- gtonkin
- MVP
- Posts: 1202
- Joined: Thu May 06, 2010 3:03 pm
- OLAP Product: TM1
- Version: Latest and greatest
- Excel Version: Office 365 64-bit
- Location: JHB, South Africa
- Contact:
Re: Distinguish String elements in an MDX
Try something like this Mark:
Code: Select all
FILTER(TM1SubsetAll([account1]),
[account1].currentmember.properties("MEMBER_WEIGHT")<>"1.000000")
or
FILTER(TM1DrillDownMember(TM1SubsetAll([test]),ALL,Recursive),
StrToValue([test].currentmember.properties("MEMBER_WEIGHT"))=-1)
-
- MVP
- Posts: 3654
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Distinguish String elements in an MDX
I wish there was a like or +1 button. I never knew this.Wim Gielis wrote: ↑Thu Oct 21, 2021 9:04 pm And then George Tonkin came with the solution !
1 = N typeCode: Select all
Filter( TM1SubsetAll( [Revenue_Msr] ), [Revenue_Msr].CurrentMember.Properties("ELEMENT_TYPE")="1")
2 = S type
3 = C type
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
-
- Community Contributor
- Posts: 292
- Joined: Tue Sep 06, 2016 7:55 am
- OLAP Product: TM1
- Version: 10.1.1
- Excel Version: Excel 2010
Re: Distinguish String elements in an MDX
Hi George,
The Member_Weight does work, how long has that been around?
I obviously need to pay more attention
regards,
Mark
The Member_Weight does work, how long has that been around?
I obviously need to pay more attention
regards,
Mark
-
- Community Contributor
- Posts: 292
- Joined: Tue Sep 06, 2016 7:55 am
- OLAP Product: TM1
- Version: 10.1.1
- Excel Version: Excel 2010
Re: Distinguish String elements in an MDX
Cheers George.
I even asked IBM about this, re this forum discussion:
viewtopic.php?t=14986
It is even undocumented to them!
Good work for joining the dots
I even asked IBM about this, re this forum discussion:
viewtopic.php?t=14986
It is even undocumented to them!
Good work for joining the dots
-
- MVP
- Posts: 3120
- 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: Distinguish String elements in an MDX
Credits to Georgelotsaram wrote: ↑Fri Oct 22, 2021 8:12 amI wish there was a like or +1 button. I never knew this.Wim Gielis wrote: ↑Thu Oct 21, 2021 9:04 pm And then George Tonkin came with the solution !
1 = N typeCode: Select all
Filter( TM1SubsetAll( [Revenue_Msr] ), [Revenue_Msr].CurrentMember.Properties("ELEMENT_TYPE")="1")
2 = S type
3 = C type
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
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