
My process was running fine a few times, but i'd made a mistake in which view i was using as it's datasource. One such run, i realised the error and manually cancelled the TI using the "cancel" button that appears when it's running. I fixed the error, re-ran it and the TI failed complaining that i couldn't delete a subset that's already used in a view. My code explicitly deletes the temp view first before meddling with the subsets, and had it been my code it would have failed 2nd time around, not the 5th or 6th. Upon checking and rechecking i was sure it wasn't being used by anything, but still it wouldn't run. I resorted to restarting the service and surprise surprise it's fine again. I'm going to try and prove the error later this afternoon, but does anyone else have that issue in other versions, or is it specific to 9.0? It's not worth logging if it doesn't happen in 9.1, but worth thinking about if anyone else does something similar in the TIs. My code is below if it's of any help (all from the prolog);
Code: Select all
### PARAMETERS - USER DEFINED ###
Dim1 = 'Version';
Dim2 = 'Demand Measures';
ElName1 = 'Current';
ElName2 = 'Man Hours';
ElNameZero = 'Demand Headcount';
Cube = 'Demand';
### PARAMETERS - SYSTEM DEFINED ###
ViewName = 'zTemp';
SubName = 'zTemp';
ViewZero = 'zTempZero';
SubZero = 'zTempZero';
### DON'T LOG ANY CHANGES ###
CubeSetLogChanges(Cube, 0);
### CREATE TEMP VIEW ###
IF ( ViewExists ( Cube , ViewName ) = 1);
ViewDestroy ( Cube , ViewName );
ENDIF;
IF ( ViewExists ( Cube , ViewZero ) = 1);
ViewDestroy ( Cube , ViewZero );
ENDIF;
ViewCreate ( Cube, ViewName );
ViewCreate ( Cube, ViewZero );
ViewExtractSkipZeroesSet ( Cube , ViewName , 1 );
ViewExtractSkipCalcsSet ( Cube , ViewName , 1 );
ViewExtractSkipRuleValuesSet ( Cube, ViewName, 1 );
ViewExtractSkipZeroesSet ( Cube , ViewZero , 1 );
ViewExtractSkipCalcsSet ( Cube , ViewZero , 1 );
ViewExtractSkipRuleValuesSet ( Cube, ViewZero, 1 );
### CREATE TEMP SUBSETS ###
### delete if already there ###
IF ( SubsetExists ( Dim1 , SubName) = 1);
SubsetDestroy ( Dim1, SubName );
EndIF;
IF ( SubsetExists ( Dim2 , SubName ) = 1);
SubsetDestroy ( Dim2, SubName );
EndIF;
#IF ( SubsetExists ( Dim1 , SubZero) = 1);
# SubsetDestroy ( Dim1, SubZero );
#EndIF;
IF ( SubsetExists ( Dim2 , SubZero ) = 1);
SubsetDestroy ( Dim2, SubZero );
EndIF;
### create new ones ###
#SubsetCreatebyMDX('zTemp', '{TM1SUBSETALL( [' | Dim1 | '] )}' );
#SubsetCreatebyMDX('zTemp', '{TM1SUBSETALL( [' | Dim2 | '] )}' );
SubsetCreate ( Dim1, SubName );
SubsetCreate ( Dim2, SubName );
#SubsetCreate ( Dim1, SubZero );
SubsetCreate ( Dim2, SubZero );
### fill new ones ###
SubsetElementInsert ( Dim1, SubName , ElName1, 1);
SubsetElementInsert ( Dim2, SubName , ElName2, 1);
SubsetElementInsert ( Dim2, SubZero , ElNameZero, 1);
### ASSIGN TEMP SUBSETS TO TEMP VIEW ###
ViewSubsetAssign ( Cube , ViewName , Dim1, SubName );
ViewSubsetAssign ( Cube , ViewName , Dim2, SubName );
ViewSubsetAssign ( Cube , ViewZero , Dim1, SubName );
ViewSubsetAssign ( Cube , ViewZero , Dim2, SubZero );
#ProcessQuit;
#Zero a view if required
ViewZeroOut ( Cube , ViewZero );