RCO wrote:I know I could create an attribute an flag those elements
Per what Lotsa said, the bottom line is that the rule applies to
cells not
elements - a key difference to get your head around.
RCO wrote:I'm unsure on whether the is TI function or any other way to identify/flag which elements are rule based.
It would be great to have CellIsRuleCalculated(sCubeName, V1, V2...) instead of CellIsUpdateable(sCubeName, V1, V2...) but it isn't there. If you're OK with just concentrating on whether the
leaf cells have rules then you can use code like this:
Code: Select all
# check if cell is all leaf level
nContinue = 1;
nCellIsLeaf = 1;
nDimensionCounter = 1;
WHILE ( nContinue =1 );
sDimension = TABDIM ( DataSourceNameForServer, nDimensionCounter );
IF ( sDimension @<> '' );
sElement = Expand ( '%V' | NumberToString ( nDimensionCounter ) | '%' );
sType = DTYPE ( sDimension, sElement );
IF ( sType @<> 'N' );
nCellIsLeaf = 0;
nContinue = 0;
ENDIF;
ELSE;
nContinue = 0;
ENDIF;
nDimensionCounter = nDimensionCounter + 1;
END;
# if cell is all leaf and not updateable then probably rule applies - note issues with LOCK etc
IF ( nCellIsLeaf = 1 & CellIsUpdateable ( DataSourceNameForServer, V1, V2, V3, V4, V5, V6, V7 ) = 0 );
nLeafHasRule = 1;
# debug
AsciiOutput ( 'out.txt', V1, V2, V3, V4, V5, V6, V7, vValue );
ELSE;
nLeafHasRule = 0;
ENDIF;
Note this relies on all variables being named V1, V2, V3 etc
I'd echo Lotsa's request to know why you want to do this - out of curiousity?