I keep getting an error when attempting to build a subset within TI off of a database view. As always, I appreciate any and all feedback.
Background
I am trying to create a subset that is dynamically updated following a dimension build (inserting new accounts, sorting each level, removing one level and ensuring ExpandAboveFlag/Aliases are turned on). I tried using MDX and then copying a temp MDX subset to another subset which didnt work, basically the expand above function left the the L3 element at the top whereas it should have been at the bottom of the subset???
Following that, I have created a database view with the accounts in the correct order in one column (both elements and consolidations - sElement below) as well as the Index Number (Index below). I assume that this would work because all I am doing is effectively using the "SubsetDimensionInsert" function (as shown in the code below) but I am getting the following error:
Error: Prolog procedure line (21): Dimension element not found
The dimension exists and the subset is actually created???
DataBase Table View
Index sElement (accounts) Element Level (Not part of view - just to show)
1 440101 N
2 440150 N
3 440190 N
4 Revenue Offset L2
5 Other Revenue L3
Code: Select all
TI SCRIPT - (In the PROLOG tab)
#--------VARIABLES
DimName = 'Accounts_IS_Testing';
Schedule1_Subset = 'Schedule 1 - Other Revenue TEST';
sElement = see table above
Index = see table above
#------Deletes old subset and creates new one
IF(SubsetExists(DimName, Schedule1_Subset )=1);
SubsetDestroy(DimName, Schedule1_Subset );
ENDIF;
SubsetCreate(DimName,Schedule1_Subset);
#-----Inserts Elements into Subset & turns the Aliases on
SubsetElementInsert(DimName, Schedule1_Subset , sElement, Index);
SubsetAliasSet(DimName, Schedule1_Subset,'GLAccountCodeDescription');