Could anyone share or point me to some TI examples for managing hierarchy updates?
My hierarchy import file is in the format of:
Child Parent Weight ChildAlias
I imagine the logic is something like this:
(1) if child or parent doesn't exist, create and associate
(2) if they exist, but aren't currently child/parent or if aliases have changed, update association/aliases
(3) remove instances no longer in hierarchy (would need to control which subset is subject to the "clean-up" so that alternative rollups/metrics are not removed)
Thanks,
-- John
Hierarchy Updates / Mgmt
- jim wood
- Site Admin
- Posts: 3958
- Joined: Wed May 14, 2008 1:51 pm
- OLAP Product: TM1
- Version: PA 2.0.7
- Excel Version: Office 365
- Location: 37 East 18th Street New York
- Contact:
Re: Hierarchy Updates / Mgmt
We do it in 2 steps. Firstly we remove any current relationship for any child level item in the file (To avoid duplication) and then we re-run it through to then re-establish child - parent relationships and ad any new children. We do it this way so we don't loose any data associated with elements that are no longer in the file. For us this either means product or outlets. Our underlying systems only keep product / outlets for the current season,
Jim.
Removing Current Relationships All in MetaData Tab:
Re-Adding them back in:
Prolog:
MetaData:
Jim.
Removing Current Relationships All in MetaData Tab:
Code: Select all
V11=ELPAR('taps sandbox leaf',V7,1);
DimensionElementComponentDelete('taps sandbox leaf',V11,V7);
Prolog:
Code: Select all
DIMENSIONSORTORDER('taps sandbox leaf','ByInput','ASCENDING','ByHierarchy','ASCENDING');
ATTRDELETE('taps sandbox leaf','Description');
ATTRINSERT('taps sandbox leaf','','Description','A');
Code: Select all
V10='All Products';
V11=if(V2@='FOOTWEAR & ACCESSORIES','Footwear',if(V2@='LADIES BRANDS & ESSENTIALS','Ladieswear',if(V2@='LADIES MAINSTREAM','Ladieswear',if(V2@='LADIES
FASHION','Ladieswear',V2))));
DIMENSIONELEMENTINSERT('taps sandbox leaf','',V7,'n');
DIMENSIONELEMENTINSERT('taps sandbox leaf','',V10,'c');
DIMENSIONELEMENTINSERT('taps sandbox leaf','',V11,'c');
DIMENSIONELEMENTCOMPONENTADD('taps sandbox leaf',V10,V2,1.000000);
DIMENSIONELEMENTCOMPONENTADD('taps sandbox leaf',V11,V7,1.000000);
Struggling through the quagmire of life to reach the other side of who knows where.
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
-
- Posts: 125
- Joined: Tue Jun 02, 2009 7:05 pm
- OLAP Product: TM1, PAX, PAW, SPSS
- Version: 2.0.916.10 on RHEL
- Excel Version: 2016
- Location: Minneapolis, MN
Re: Hierarchy Updates / Mgmt
Jim, thank you for sharing. I'm sure I'll be able to leverage your code.
I'll have to add in a way to preserve attributes on consolidated/leaf members that aren't part of the dimension load probably by creating a backup of the dimension first, running your steps, and the reestablishing the attributes.
I'll post my code when complete.
I'll have to add in a way to preserve attributes on consolidated/leaf members that aren't part of the dimension load probably by creating a backup of the dimension first, running your steps, and the reestablishing the attributes.
I'll post my code when complete.