I am currently writing a process that is supposed to take the names of dimensions and elements within that dimension as parameters and zero out the data at their intersections. I can Zero out entire Dimensions no problem or even the entire cube. My question is I'm having trouble zeroing out Consolidations within the cube. What it should do is Zero out from the consolidation given down to the leaf level. I am having issues doing so and I dont know if i'm going about this wrong or not
For one of the parameters the approach im taking is to create a subset by MDX like below
Code: Select all
#Create the subsets
IF(~(dimension1Name @= ''));
curLevel = ELLEV(dimension1Name,dimension1Value);
If(dimension1Value @= '' % DTYPE (dimension1Name,dimension1Value) @= 'N');
MDX1 = '{TM1FILTERBYLEVEL( {TM1SUBSETALL( [' | dimension1Name | '] )}, 0)}';
SubsetCreatebyMDX('Subset1',MDX1);
ELSEIF((~(dimension1Value @='')) % DTYPE(dimension1Name,dimension1Value) @= 'C');
#get the elements
level = ELLEV(dimension1Name,dimension1Value);
#ASCIIOutput('C:\LevelNumber.txt',NumberToString(level));
MDX1 = '{TM1FILTERBYLEVEL( {TM1SUBSETALL( [' | dimension1Name | '] )},level)}';
SubsetCreatebyMDX('Subset1',MDX1);
ENDIF;
ViewSubsetAssign(cubeName,'zeroStream',dimension1Name,'Subset1');
ENDIF;