I want a dynamic subset that is based on a value stored in another dimension-subset.
I'm starting with this, which works fine:
{TM1FILTERBYPATTERN( {TM1SUBSETALL( [Organization] )},
"EC4GB"
)}
But what I actually want to test on is in another dimension subset: [ForecastOrg].[DynamicTop]
( Forecast org is a less deep hierarchy that has a common upper level)
This dynamic subset contains a single item which happens to be "EC4GB"
I've tried lots of variations of
{TM1FILTERBYPATTERN( {TM1SUBSETALL( [Organization] )},
[ForecastOrg].[DynamicTop]
)}
but none of them compile. Can this be done? What is the syntax.
THanks.
MDX TM1FILTERBYPATTERN - from a subset
- qml
- MVP
- Posts: 1096
- Joined: Mon Feb 01, 2010 1:01 pm
- OLAP Product: TM1 / Planning Analytics
- Version: 2.0.9 and all previous
- Excel Version: 2007 - 2016
- Location: London, UK, Europe
Re: MDX TM1FILTERBYPATTERN - from a subset
Not sure what you want to achieve exactly, but in this particular case you don't need TM1FILTERBYPATTERN. All you need is:
Code: Select all
{[ForecastOrg].[DynamicTop]}
Kamil Arendt
-
- Posts: 60
- Joined: Mon Jun 06, 2011 6:07 pm
- OLAP Product: TM1
- Version: 9.5.2
- Excel Version: 2010
Re: MDX TM1FILTERBYPATTERN - from a subset
{[ForecastOrg].[DynamicTop]} gives me a subset from the ForecastOrg Dimension
I actually want a subset from the Organization dimension.
From what I can tell, mdx relates the subset to the dimension first mentioned.
ForecastOrg is shallow
Total
-EC4IND
-EC4GB
Organization is deep
Total
-EC4IND
--7 more levels below
-EC4GB
-- 7 more levels below this.
ie. EC4GB is a child in ForecastOrg, but a Consolidation in ForecastOrg.
I actually want a subset from the Organization dimension.
From what I can tell, mdx relates the subset to the dimension first mentioned.
ForecastOrg is shallow
Total
-EC4IND
-EC4GB
Organization is deep
Total
-EC4IND
--7 more levels below
-EC4GB
-- 7 more levels below this.
ie. EC4GB is a child in ForecastOrg, but a Consolidation in ForecastOrg.
-
- Posts: 9
- Joined: Wed Mar 07, 2012 11:06 pm
- OLAP Product: Cognos Express
- Version: 10.2.2
- Excel Version: 2007 2010
- Location: Vancouver, Canada
Re: MDX TM1FILTERBYPATTERN - from a subset
I think it's the DynamicTop that is giving you problems. It doesn't seem to be recognized by TM1. If you type it into the expression window of the Subset Editor you get the same "Failed to compile MDX expression" message. What is the logic for the MDX to pick just the single element EC4GB from the multiple elements in ForecastOrg ? Perhaps a differnt expression will work.
-
- MVP
- Posts: 733
- Joined: Wed May 14, 2008 11:06 pm
Re: MDX TM1FILTERBYPATTERN - from a subset
pmakulski wrote:I want a dynamic subset that is based on a value stored in another dimension-subset.
So you want a dynamic subset in the ForecastOrg dimension that refers to a subset in the Organization dimension? I don't think that it is possible to refer to a dimension (in your MDX) other than the one for which you are writing the expression. Are you getting the 'incorrect dimension for subset' error?pmakulski wrote:{[ForecastOrg].[DynamicTop]} gives me a subset from the ForecastOrg Dimension
I actually want a subset from the Organization dimension.
Robin Mackenzie
-
- Posts: 60
- Joined: Mon Jun 06, 2011 6:07 pm
- OLAP Product: TM1
- Version: 9.5.2
- Excel Version: 2010
Re: MDX TM1FILTERBYPATTERN - from a subset
Doh!
OK, I've read over the suggestions. Thanks for them.
The easy answer to my problem above was to replicate the [DynamicTop] subset in the Organization dimension.
[ForecastOrg].[DynamicTop] is
So [Organization].[DynamicTop] can be
So now they both return the single item EC4GB (if that is what the }Client DefaultTop attribute calls for.
But I think the reason I wanted to reference the other dimension's subset was to do more than one item. (I got around the problem by making the needed subset on the fly in a TI,
but I think it is still an interesting exercise).
Basically {TM1Filter( {TM1SUBSETALL([Organization]), {This other list of similar looking items from [ForecastOrg].[AnotherSubset] )};
OK, I've read over the suggestions. Thanks for them.
The easy answer to my problem above was to replicate the [DynamicTop] subset in the Organization dimension.
[ForecastOrg].[DynamicTop] is
Code: Select all
{FILTER( {TM1SUBSETALL([ForecastOrg])} ,
[Forecast].CurrentMember.Name =
[}ElementAttributes_}Clients].(StrToMember("[}Clients].[" + USERNAME +"]"),[}ElementAttributes_}Clients].[DefaultTop])
)}
Code: Select all
{FILTER( {TM1SUBSETALL([Organization])} ,
[Organization].CurrentMember.Name =
[}ElementAttributes_}Clients].(StrToMember("[}Clients].[" + USERNAME +"]"),[}ElementAttributes_}Clients].[DefaultTop])
)}
But I think the reason I wanted to reference the other dimension's subset was to do more than one item. (I got around the problem by making the needed subset on the fly in a TI,
but I think it is still an interesting exercise).
Basically {TM1Filter( {TM1SUBSETALL([Organization]), {This other list of similar looking items from [ForecastOrg].[AnotherSubset] )};