Recreating Hierarchy by Attribute

Post Reply
michalb
Posts: 14
Joined: Thu Dec 03, 2020 3:45 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010

Recreating Hierarchy by Attribute

Post by michalb »

Hi,

I use process in which I recreate hierarchy by attribute for certain dimension. I would say it is standard:

Code: Select all

cDimName = 'Customer';

sAttrName = 'Customer Group';

sBlankSubstitute = 'No Cust Group';

sRootName = 'All Customer Groups';

sHierName = 'Customer Group';

IF ( HierarchyExists ( cDimName , sHierName ) = 1);

HierarchyDestroy ( cDimName , sHierName );

ENDIF;

CreateHierarchyByAttribute( cDimName, sAttrName , sBlankSubstitute , sRootName );
Problem occured when I started using hierarchy specific consolidation in a rule in one cube, containing that dimension, as a feeder. Now process that refresh hierarchy by attribute returns error:
Error: Prolog procedure line (74): Cost Plan Dimension Update Fail. Rule Is Invalid. Until rule is fixed
So I was thinking about three solutions:
- turn off rules in prologue of the process and then turn them on in epilogue (is it possible?)
- finding function that recreates hierarchy by attribute that don't require using HierarchyDestroy before (using CreateHierarchyByAttribute without using HierarchyDestroy before returns error)
- creating my own alternative hierarchy based on attributes without using function CreateHierarchyByAttribute and just use HierarchyDeleteAllElements instead of using HierarchyDestroy before

I would appriciate any recommended logical approches to this issue :)
Regards,
Michal
burnstripe
Regular Participant
Posts: 197
Joined: Wed May 06, 2020 2:58 pm
OLAP Product: Planning Analytics
Version: 2.0.9
Excel Version: 2016

Re: Recreating Hierarchy by Attribute

Post by burnstripe »

This would be the approach I would take

- creating my own alternative hierarchy based on attributes without using function CreateHierarchyByAttribute and just use HierarchyDeleteAllElements instead of using HierarchyDestroy before

Except I would perform this all in the metadata tab. If the elements are destroyed and rebuilt in the metadata, as long as elements referred to in the rule still exist when the metadata completes you won't get the error you've been experiencing
JohnO
Posts: 96
Joined: Mon Jul 29, 2019 5:02 am
OLAP Product: Planning Analytics
Version: 2.0.9.x
Excel Version: Office 365 16

Re: Recreating Hierarchy by Attribute

Post by JohnO »

michalb wrote: Sat Oct 21, 2023 3:05 pm

- finding function that recreates hierarchy by attribute that don't require using HierarchyDestroy before (using CreateHierarchyByAttribute without using HierarchyDestroy before returns error)
I see CreateHierarchyByAttribute as just a way of simple introduction to building hierarchies. It's very limited in concept and application.

You will find most functions here:
https://www.ibm.com/docs/en/planning-an ... -functions

There there are more in here:
https://www.ibm.com/docs/en/planning-an ... -functions

And here:
https://www.ibm.com/docs/en/planning-an ... -functions

And maybe there are others.

And then concepts of the 'Leaves' is an important one in terms of what gets deleted when you maniupulate a hierarchy. I found this a short but useful reference:

https://cubewise.com/blog/hierarchies-e ... ent-model/ I think they were referring to "HierarchyDeleteAllElements" in that section about leaves.

There are also some additional rules functions.

it's really a whole new world which I think the majority have not ventured into because of the limited support to date (Including PAfE 2.0.90 in this statement) for hierarchies in the Excel/ websheet UI's. You really have to ensure that your existing rules will work with all hierarchies or educate users on the specific in when specific hierarchies can be used. And rule based aggregate overrides because a factor harder.
Post Reply