Source MDX from Tm1 Cube text with variable, then create sub
Posted: Fri Sep 13, 2013 5:38 am
Hi there, This is a curly.
I am testing a concept by where I enter my MDX string into a cube and then extract the MDX string into a TI with CellGetS, then SubsetCreatebyMDX
Due to MDX being long strings I also break my MDX into parts using concatenated variables eg.
vMDX = '{ TM1FILTERBYLEVEL( {TM1SUBSETALL( [' | vDimName | '] ) }, 0 ) }';
vMDX = '{ TM1SORT( ' | vMDX | ', ASC) }';
I have discovered if I have the string '{ TM1FILTERBYLEVEL( {TM1SUBSETALL( [' | vDimName | '] ) }, 0 ) }' in my cube CellGetS does not recognise the concatenate and variable vDimName and subsequent SubsetCreatebyMDX will error as "Syntax error at or near: '| vDimName | "'] ) }'"
Does anyone know a method to parse the string parts from the variable so the SubsetCreatebyMDX will not error? I have searched but there is nothing aparent
Cheers
GG
I am testing a concept by where I enter my MDX string into a cube and then extract the MDX string into a TI with CellGetS, then SubsetCreatebyMDX
Due to MDX being long strings I also break my MDX into parts using concatenated variables eg.
vMDX = '{ TM1FILTERBYLEVEL( {TM1SUBSETALL( [' | vDimName | '] ) }, 0 ) }';
vMDX = '{ TM1SORT( ' | vMDX | ', ASC) }';
I have discovered if I have the string '{ TM1FILTERBYLEVEL( {TM1SUBSETALL( [' | vDimName | '] ) }, 0 ) }' in my cube CellGetS does not recognise the concatenate and variable vDimName and subsequent SubsetCreatebyMDX will error as "Syntax error at or near: '| vDimName | "'] ) }'"
Does anyone know a method to parse the string parts from the variable so the SubsetCreatebyMDX will not error? I have searched but there is nothing aparent
Cheers
GG