I want to create Drill process to another cube. One of destinations cube elements have MDX subset, that's pointing another subset, to walkaround problem with deleteing subsets when they are useb by view (found on this forum).
Code: Select all
{[Dim].[Subset_for_recreation]}
Code: Select all
# Deleting Subset if exists
If(SubsetExists('Acc', 'Subset_for_recreation')=1);
SubsetDestroy('Acc', 'Subset_for_recreation');
EndIf;
#Variable mapping
Position = '"*""' | DIMNM('PL',DIMIX('PL',PL)) | '""*"';
DummyElement = 'xyz"' | DIMNM('PL',DIMIX('PL',PL));
MDX = '{TM1FILTERBYPATTERN( {TM1SORT( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [Acc] )}, 0)}, ASC)}, '|Position|')}';
#Adding dummy element to walkaround that values for filtering are on alias
DimensionElementInsert('PL', '',DummyElement,'N');
SubsetCreatebyMDX('PLDrill', MDX);
SubsetAliasSet('PL', 'PLDrill', 'PLPosition' );
DimensionElementDelete('PL',DummyElement);
I'm working on Cognos Express 9.5