Single TI process for many cube copies?
Posted: Fri Feb 11, 2011 4:52 am
Hi There,
my TI Process prolog creates a datasource, source and target views, zeros target and uses parameter 'pTargetVersion' and user variable 'CubeVariable' from a control TI Process. This part is resuable for all cubes with Budget_Version.
I want to create a reusable data section. But because we have to choose a datasource and view then define its variables I cannot see how to do this dynamically with the data. I have an issue with the variables and especially the vValue variable I would normally define in the variables section of the TI process.
Does anyone have any suggestions. See my attempt (not tested ) below...cheers
my TI Process prolog creates a datasource, source and target views, zeros target and uses parameter 'pTargetVersion' and user variable 'CubeVariable' from a control TI Process. This part is resuable for all cubes with Budget_Version.
I want to create a reusable data section. But because we have to choose a datasource and view then define its variables I cannot see how to do this dynamically with the data. I have an issue with the variables and especially the vValue variable I would normally define in the variables section of the TI process.
Does anyone have any suggestions. See my attempt (not tested ) below...cheers
Code: Select all
mycubename = CubeVariable;
myTarget = pTargetVersion;
#maximum 8 dimensions in a cube
DimMax = 8;
DimLast = TabDim ( mycubename , DimMax );
While ( DimLast @= '' );
DimMax = DimMax - 1;
End;
#Reuse once recieved all Dim variables below
counter = 1;
While( TABDIM(mycubename , counter) @<> '' );
#repeat 8 times as this is the max assumed for Budget Version cubes. If Budget_Version dim then make target version.
If(counter = 1);
If(TABDIM(mycubename , counter) @= 'Budget_Version');
Dim1 = myTarget;
ELSE;
Dim1 = TABDIM(mycubename , counter);
ENDIF;
elseIf(counter = 2);
If(TABDIM(mycubename , counter) @= 'Budget_Version');
Dim2 = myTarget;
ELSE;
Dim2 = TABDIM(mycubename , counter);
ENDIF;
elseIf(counter = 3);
If(TABDIM(mycubename , counter) @= 'Budget_Version');
Dim3 = myTarget;
ELSE;
Dim3 = TABDIM(mycubename , counter);
ENDIF;
elseIf(counter = 4);
If(TABDIM(mycubename , counter) @= 'Budget_Version');
Dim4 = myTarget;
ELSE;
Dim4 = TABDIM(mycubename , counter);
ENDIF;
elseIf(counter = 5);
If(TABDIM(mycubename , counter) @= 'Budget_Version');
Dim5 = myTarget;
ELSE;
Dim5 = TABDIM(mycubename , counter);
ENDIF;
elseIf(counter = 6);
If(TABDIM(mycubename , counter) @= 'Budget_Version');
Dim6 = myTarget;
ELSE;
Dim6 = TABDIM(mycubename , counter);
ENDIF;
elseIf(counter = 7);
If(TABDIM(mycubename , counter) @= 'Budget_Version');
Dim7 = myTarget;
ELSE;
Dim7 = TABDIM(mycubename , counter);
ENDIF;
elseIf(counter = 8);
If(TABDIM(mycubename , counter) @= 'Budget_Version');
Dim8 = myTarget;
ELSE;
Dim8 = TABDIM(mycubename , counter);
endif;
ENDIF;
counter = counter + 1;
End;
#now use dimmax again
If(DimMax = 3);
CellPutN(vValue,mycubename,Dim1,Dim2,Dim3);
elseIf(DimMax = 4);
CellPutN(vValue,mycubename,Dim1,Dim2,Dim3,Dim4);
elseIf(DimMax = 5);
CellPutN(vValue,mycubename,Dim1,Dim2,Dim3,Dim4,Dim5);
elseIf(DimMax = 6);
CellPutN(vValue,mycubename,Dim1,Dim2,Dim3,Dim4,Dim5,Dim6);
elseIf(DimMax = 7);
CellPutN(vValue,mycubename,Dim1,Dim2,Dim3,Dim4,Dim5,Dim6,Dim7);
elseIf(DimMax = 8);
CellPutN(vValue,mycubename,Dim1,Dim2,Dim3,Dim4,Dim5,Dim6,Dim7,Dim8);
endif;