How select dimension that start with defined letters

Product:
Planning Analytics 2.0.6
Microsoft Windows 2012 server

Problem:
How make a subset of a dimension, where i want all elements that start with BSA* and some other letters, like BSB and BSC?

Suggested Solution:
In your prolog section of the TI process, use UNION, similar to this:

sSubset=’export’;
pDim13=’company’;

StringMDX = ‘ (UNION(
(UNION (
{UNION( { TM1FILTERBYPATTERN( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [ ‘ | pDim13 | ‘ ] )}, 0)}, “BSA*” ) } ,
{ TM1FILTERBYPATTERN( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [ ‘ | pDim13 | ‘ ] )}, 0)}, “BSB*” ) } )} ,
{UNION( { TM1FILTERBYPATTERN( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [ ‘ | pDim13 | ‘ ] )}, 0)}, “BSC*” ) } ,
{ TM1FILTERBYPATTERN( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [ ‘ | pDim13 | ‘ ] )}, 0)}, “BSD*” ) } )} )) ,
(UNION (
{UNION( { TM1FILTERBYPATTERN( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [ ‘ | pDim13 | ‘ ] )}, 0)}, “BSE*” ) } ,
{ TM1FILTERBYPATTERN( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [ ‘ | pDim13 | ‘ ] )}, 0)}, “BSF*” ) } )} ,
{UNION( { TM1FILTERBYPATTERN( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [ ‘ | pDim13 | ‘ ] )}, 0)}, “BSH*” ) } ,
{ TM1FILTERBYPATTERN( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [ ‘ | pDim13 | ‘ ] )}, 0)}, “BSJ*” ) } )} ))
)) ‘;

SubsetCreatebyMDX( sSubset ,StringMDX);

 

This can be solved in other ways, this is only a suggestion.

 

More Information:

http://www.wimgielis.com/tm1_mdxstatements_EN.htm

https://www.bihints.com/book/export/html/68

https://www.ibm.com/support/knowledgecenter/en/SS9RXT_10.2.2/com.ibm.swg.ba.cognos.tm1_ref.10.2.2.doc/c_tm1-specificmdxfunctions_n20311.html