All Agency Numbers (top level)
|-Head office
|-|-Division
|-|-|-Region
|-|-|-|-Branch
There is a separate dimension of Sales People (referred to as BDE's). Each BDE is in charge of a number of offices.
I would like to change the hierarchy above to be as follows:
All Agency Numbers (still top level)
|-BDE
|-|-Head office
|-|-|-Division
|-|-|-|-Region
|-|-|-|-|-Branch
I am very new to TM1. Can anyone please advise me how the TI should be modified to do this?
Many thanks in advance,
Code: Select all
lng_Index = 0;
# check whether the agency number exists
lng_Index = DimIx( s_DimzzBrokerNo, vAgencyNumber );
If ( lng_Index = 0 & Load_zzBDE = 1 );
# agency number not found
# check whether the head office exists
# if the index returns zero (not found) add it to 'All' hierarchy at consolidation level
lng_Index = DimIx( s_DimzzBrokerBDE, vHeadOffice_ICEref );
If ( lng_Index = 0 );
DimensionElementInsert( s_DimzzBrokerBDE, '', vHeadOffice_ICEref, 'C');
DimensionElementComponentAdd( s_DimzzBrokerBDE, 'All Agency Numbers', vHeadOffice_ICEref, 1);
EndIf;
# check whether the division exists
# if the index returns zero (not found) add it to head office as consolidation level
lng_Index = DimIx( s_DimzzBrokerBDE, vDivision_ICEref );
If ( lng_Index = 0 );
DimensionElementInsert( s_DimzzBrokerBDE, '', vDivision_ICEref, 'C');
DimensionElementComponentAdd( s_DimzzBrokerBDE, vHeadOffice_ICEref, vDivision_ICEref, 1);
EndIf;
# check whether the region exists
# if the index returns zero (not found) add it to division as consolidation level
lng_Index = DimIx( s_DimzzBrokerBDE, vRegion_ICEref );
If ( lng_Index = 0 );
DimensionElementInsert( s_DimzzBrokerBDE, '', vRegion_ICEref, 'C');
DimensionElementComponentAdd( s_DimzzBrokerBDE, vDivision_ICEref, vRegion_ICEref, 1);
EndIf;
# check whether the branch office exists
# if the index returns zero (not found) add it to region as consolidation level
lng_Index = DimIx( s_DimzzBrokerBDE, vBranchOffice_ICEref );
If ( lng_Index = 0 );
DimensionElementInsert( s_DimzzBrokerBDE, '', vBranchOffice_ICEref, 'C');
DimensionElementComponentAdd( s_DimzzBrokerBDE, vRegion_ICEref, vBranchOffice_ICEref, 1);
EndIf;
# load the agency number to the branch office
DimensionElementComponentAdd( s_DimzzBrokerBDE, vBranchOffice_ICEref, vAgencyNumber, 1);
EndIf;