Subsetdefinition don't accept foreign Dimension

Post Reply
schlemiel29
Posts: 68
Joined: Tue May 08, 2012 8:29 am
OLAP Product: TM/1
Version: 11.8
Excel Version: Excel 365

Subsetdefinition don't accept foreign Dimension

Post by schlemiel29 »

Hi all,
I discovered a strange behavior. I use a cube with dimensions, which have the same elements as the dimeniion in which I want to define a dynamic MDX based subset. So I have I dimension "KW" and a cube (}FILTER_KW_ORG) with 4 dimensions: }KW_N, }KW_N_Von, }KW_N_Bis and }FILTER_KW.
The dimension }KW_N owns the same elements than KW, but are all n elements.

To define a subset based on this cube I try to use:

Code: Select all

{ FILTER (
  { TM1SUBSETALL( [KW] )},
  [}FILTER_KW_ORG].(
    [KW].CurrentMember,  
    StrToMember( "[}KW_N_Von].["+ [}TM1Config_UserSelection].( StrToMember( "[}Clients].["+USERNAME+"]"), [}TM1Config_UserSelectionDimElement].[}KW_N_Von] ) +"]") ,
    StrToMember( "[}KW_N_Bis].["+ [}TM1Config_UserSelection].( StrToMember( "[}Clients].["+USERNAME+"]"), [}TM1Config_UserSelectionDimElement].[}KW_N_Bis] ) +"]") ,
    StrToMember( "[}FILTER_KW].["+ [}TM1Config_UserSelection].( StrToMember( "[}Clients].["+USERNAME+"]"), [}TM1Config_UserSelectionDimElement].[}FILTER_KW] ) +"]") 
    ) > 0
) }
Problem ist the first parameter for the cube:

Code: Select all

[KW].CurrentMember
This is not accepted. I also tried

Code: Select all

[KW].CurrentMember.Name
Unsuccessful. But using a fixed string worked fine:

Code: Select all

{ FILTER (
  { TM1SUBSETALL( [KW] )},
  [}FILTER_KW].(
    StrToMember( "[}KW_N].["+ "202102" +"]"), 
    StrToMember( "[}KW_N_Von].["+ [}TM1Config_UserSelection].( StrToMember( "[}Clients].["+USERNAME+"]"), [}TM1Config_UserSelectionDimElement].[}KW_N_Von] ) +"]") ,
    StrToMember( "[}KW_N_Bis].["+ [}TM1Config_UserSelection].( StrToMember( "[}Clients].["+USERNAME+"]"), [}TM1Config_UserSelectionDimElement].[}KW_N_Bis] ) +"]") ,
    StrToMember( "[}FILTER_KW].["+ [}TM1Config_UserSelection].( StrToMember( "[}Clients].["+USERNAME+"]"), [}TM1Config_UserSelectionDimElement].[}FILTER_KW] ) +"]") 
    ) > 0
) }
When using exactly the same logik with the dimension used in the cube, it worked fine too:

Code: Select all

{ FILTER (
  { TM1SUBSETALL( [}KW_N] )},
  [}FILTER_KW].(
    [}KW_N].CurrentMember, 
    StrToMember( "[}KW_N_Von].["+ [}TM1Config_UserSelection].( StrToMember( "[}Clients].["+USERNAME+"]"), [}TM1Config_UserSelectionDimElement].[}KW_N_Von] ) +"]") ,
    StrToMember( "[}KW_N_Bis].["+ [}TM1Config_UserSelection].( StrToMember( "[}Clients].["+USERNAME+"]"), [}TM1Config_UserSelectionDimElement].[}KW_N_Bis] ) +"]") ,
    StrToMember( "[}FILTER_KW].["+ [}TM1Config_UserSelection].( StrToMember( "[}Clients].["+USERNAME+"]"), [}TM1Config_UserSelectionDimElement].[}FILTER_KW] ) +"]") 
    ) > 0
) }
So I used two cubes with the apropriate dimensions to setup the subsets, but is there a more elegant solution? Why couldn't I use string manipulation to get a plain string like "202102"?
Thanks in advance
Dirk
burnstripe
Regular Participant
Posts: 219
Joined: Wed May 06, 2020 2:58 pm
OLAP Product: Planning Analytics
Version: 2.0.9
Excel Version: 2016

Re: Subsetdefinition don't accept foreign Dimension

Post by burnstripe »

Have you tried this

Code: Select all

FILTER (
  { TM1SUBSETALL( [KW] )},
  [}FILTER_KW].(
    StrToMember( "[}KW_N].["+ [KW].CurrentMember.Name +"]"), 
    StrToMember( "[}KW_N_Von].["+ [}TM1Config_UserSelection].( StrToMember( "[}Clients].["+USERNAME+"]"), [}TM1Config_UserSelectionDimElement].[}KW_N_Von] ) +"]") ,
    StrToMember( "[}KW_N_Bis].["+ [}TM1Config_UserSelection].( StrToMember( "[}Clients].["+USERNAME+"]"), [}TM1Config_UserSelectionDimElement].[}KW_N_Bis] ) +"]") ,
    StrToMember( "[}FILTER_KW].["+ [}TM1Config_UserSelection].( StrToMember( "[}Clients].["+USERNAME+"]"), [}TM1Config_UserSelectionDimElement].[}FILTER_KW] ) +"]") 
    ) > 0
) }
When using exactly the 
Note the [KW].CurrentMember.Name within the strtomember
MarenC
Regular Participant
Posts: 409
Joined: Sat Jun 08, 2019 9:55 am
OLAP Product: Planning Analytics
Version: Planning Analytics 2.0
Excel Version: Excel 2016

Re: Subsetdefinition don't accept foreign Dimension

Post by MarenC »

Hi,

I am not sure I would call this strange behaviour, and I am also wondering why you didn't just put the KW dimension in the }FILTER_KW_ORG cube, instead of }KW_N? This would have avoided the issue I think.

Maren
schlemiel29
Posts: 68
Joined: Tue May 08, 2012 8:29 am
OLAP Product: TM/1
Version: 11.8
Excel Version: Excel 365

Re: Subsetdefinition don't accept foreign Dimension

Post by schlemiel29 »

Oh, that's simple. I want a flat dimension (}KW_N) , so I don't need any special rule or feeders. Just take the data from another cube.
schlemiel29
Posts: 68
Joined: Tue May 08, 2012 8:29 am
OLAP Product: TM/1
Version: 11.8
Excel Version: Excel 365

Re: Subsetdefinition don't accept foreign Dimension

Post by schlemiel29 »

@burnstripe: Yes, I also tried "[KW].CurrentMember.Name". So I didn't understand, what kind of data is
- CurrentMember.Name
- CurrentMember

I assumed they are simply strings, so if "202101" works, it should work with any kind of strings.
MarenC
Regular Participant
Posts: 409
Joined: Sat Jun 08, 2019 9:55 am
OLAP Product: Planning Analytics
Version: Planning Analytics 2.0
Excel Version: Excel 2016

Re: Subsetdefinition don't accept foreign Dimension

Post by MarenC »

Oh, that's simple. I want a flat dimension (}KW_N) , so I don't need any special rule or feeders. Just take the data from another cube.
How would a flat dimension affect any of that? You just ensure the front end doesn't include any parent levels for this cube.
schlemiel29
Posts: 68
Joined: Tue May 08, 2012 8:29 am
OLAP Product: TM/1
Version: 11.8
Excel Version: Excel 365

Re: Subsetdefinition don't accept foreign Dimension

Post by schlemiel29 »

If this is a dimension with all elements as N elements, a rule will always be a N rule, but as fast as a C rule, because it simply does the calculation for itself (one time) without further aggregation.
MarenC
Regular Participant
Posts: 409
Joined: Sat Jun 08, 2019 9:55 am
OLAP Product: Planning Analytics
Version: Planning Analytics 2.0
Excel Version: Excel 2016

Re: Subsetdefinition don't accept foreign Dimension

Post by MarenC »

If this is a dimension with all elements as N elements, a rule will always be a N rule, but as fast as a C rule, because it simply does the calculation for itself (one time) without further aggregation.
Well you can define rules at n level in TM1 whether there are consolidated elements in the dimension or not, so I still don't get it.
Post Reply