MDX with parameter for Attribute
Posted: Tue Dec 15, 2020 5:40 pm
Hello,
I am trying for create an MDX in a TI process but it gives me the error
"cAttrValueStart" : object not found expression.
Basically the MDX tries to filter the values in the dimension 'Time' base on a numeric attribute value.
Not sure how do I put 'cAttrValueStart' in my MDX so that it takes the value of it. There is something wrong how I am putting it in the MDX because when I just try to do ASCIIOUTPUT of it like ASCIIOUTPUT(sTargetFileName, NumberToString(cAttrValueStart) ); it gives me a value.
Please help.
cDimName = 'Time' ;
cAttr = 'Month Index Num' ;
cElNameStart = pStartPeriod ;
cElNameEnd = pEndPeriod ;
cAttrValueStart = ATTRN(cDimName, cElNameStart, cAttr) ;
cAttrValueEnd = ATTRN(cDimName, cElNameEnd, cAttr) ;
sMDX= '{FILTER( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [Time] )}, 0)}, [Time].[Month Index Num] >= cAttrValueStart AND [Time].[Month Index Num] <= cAttrValueEnd )}' ;
Thanks a lot.
I am trying for create an MDX in a TI process but it gives me the error
"cAttrValueStart" : object not found expression.
Basically the MDX tries to filter the values in the dimension 'Time' base on a numeric attribute value.
Not sure how do I put 'cAttrValueStart' in my MDX so that it takes the value of it. There is something wrong how I am putting it in the MDX because when I just try to do ASCIIOUTPUT of it like ASCIIOUTPUT(sTargetFileName, NumberToString(cAttrValueStart) ); it gives me a value.
Please help.
cDimName = 'Time' ;
cAttr = 'Month Index Num' ;
cElNameStart = pStartPeriod ;
cElNameEnd = pEndPeriod ;
cAttrValueStart = ATTRN(cDimName, cElNameStart, cAttr) ;
cAttrValueEnd = ATTRN(cDimName, cElNameEnd, cAttr) ;
sMDX= '{FILTER( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [Time] )}, 0)}, [Time].[Month Index Num] >= cAttrValueStart AND [Time].[Month Index Num] <= cAttrValueEnd )}' ;
Thanks a lot.