Issue with creating subset via TI
Posted: Tue Jul 10, 2012 1:03 pm
Hi All,
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).
Now i can delete Subset_for_recreation and use SubsetCreatebyMDX.
My problem is that ElementInsert doesn't work like i want. I comment Creating subset and process works (it is adding element). Then I rerun drill (uncomented), and I'ts worked. I'm thinking that i have to save dimension before creating subset, but i don't known how to do it.
I'm working on Cognos Express 9.5
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