I'm struggeling with creating a subset based on a MDX statement using a TI process. My process runs based on the elements of a dimension. For each element I like to create two different subsetsbymdx for differernt dimensions.
But when I run the process I get the error "..:Could not create dynamic subset" The error occurs when the second subset is created.
Code: Select all
newSubsetName = CellGetS( cCubeElementAttr, variableOfDim, 'Long Name (ID)');
#cDimName is Name of the first Dim I like to create a subset for
IF(SubsetExists(cDimName, newSubsetName) = 1);
SubsetDestroy(cDimName, newSubsetName);
ENDIF;
#Create Subset for Kat4
tmpMDX = '{[Kat4].[' | variableOfDim| '].Children}';
SubsetCreatebyMDX( newSubsetName, tmpMDX );
cName_2 is the Name of the first Dim I like to create a subset for
IF(SubsetExists(cDimName_2, newSubsetName) = 1);
SubsetDestroy(cDimName, newSubsetName);
ENDIF;
# 34 = "
#39 = '
quoteChar = Char(34);
tmpMDX = '{FILTER( {TM1FILTERBYPATTERN( {[Kat2].[All Kat2].Children},' | quoteChar | 'Kat2_EX*' | quoteChar | ')}, [Kat2].[Cost Center] = ' | quoteChar | 'Kat7_' | vKat4 | quoteChar | ')}';
Asciioutput( 'c:\temp\createsubsets.txt', getprocessName(), tmpMDX);
SubsetCreatebyMDX(newSubsetName , tmpMDX);
Then I thought probably I should use a single quote instead of a double so I changed the quoteChar variable to 39. I also tested the mdx statement with single quotes in the dimension expression view. It also worked. So single and double quotes shouldn't make a difference. Still get the same error.
Then I was wondering that when I use the subsetcreate statement I have to add the dimension name as a parameter but the subsetcreatebymdx doesn't use this parameter. Where does tm1 know to which dimension the subset has to be applied? That's why I changed the name of the second subset. But I still get the same error.
I really hope that I just missed something... because I don't know how to proceed. Has anyone a idea?