Page 1 of 1

Error while trying to build a Named Hierarchy in a TI process

Posted: Wed Jul 15, 2020 12:09 pm
by tm123
Hi,

I am facing an issue while I am trying to build a new hierarchy in a TI Process. I have a dimension which has multiple ALternate Hierarchies ( what we used to call Alternate Hierarchies), and I am trying to convert them into Named Hierarchies.

I am able to convert them all, without any issues, but when I try to create a Brand New Hierarchy, TM1 throws an error:
Insertion of leaf "xyz" into hierarchy "DimName:HierarchyName" failed because a consolidated element by that name already exists in the dimension.

The Element "xyz" needs to be a COnsolidated Element into my new Hierarchy, and I tried to Insert it as a Consolidation before trying to add components into it, but nothing seems to work.

This element "xyz" is not part Base ( Old) Hierarchy

Thanks

Re: Error while trying to build a Named Hierarchy in a TI process

Posted: Wed Jul 15, 2020 12:29 pm
by Wim Gielis
And what is your TI code ?

Re: Error while trying to build a Named Hierarchy in a TI process

Posted: Wed Jul 15, 2020 12:39 pm
by tm123
Thanks for the reply:


#== Code in Prolog Tab
HierName = 'By Product Category' ;

IF ( HierarchyExists ( dimName, HierName ) = 0 ) ;
HierarchyCreate ( dimName, HierName ) ;
ELSE ;
HierarchydeleteAllElements ( dimName, HierName ) ;
ENDIF ;
HierarchySortOrder ( dimName, HierName , 'ByInput' , 'Ascending' , 'ByHierarchy' , 'Ascending' ) ;

sHierarchyTopNode = 'All Products by Category';
HierarchyElementInsert ( dimName , HierName , '' , sHierarchyTopNode , 'C' ) ;


#== Code in Metadata Tab

HierarchyElementInsert ( dimName, HierName, '', vLeafElemName , 'N' ) ;
IF ( HierarchyElementExists ( dimName, HierName, vRollupName ) = 0 ) ;
HierarchyElementInsert ( dimName, HierName, '', vRollupName, 'C') ;
ENDIF ;

HierarchyElementComponentAdd ( dimName, HierName , sHierarchyTopNode, vRollupName, 1 ) ;
HierarchyElementComponentAdd ( dimName, HierName , vRollupName, vLeafElemName , 1 ) ;

Thanks

Re: Error while trying to build a Named Hierarchy in a TI process

Posted: Wed Jul 15, 2020 4:42 pm
by Steve Rowe
If we assume your code is correct and the error message is correct then the element must already exist.

I seem to remember being caught out by subset names clashing with new elements at one time. A by product of UDCs.

Try and dimix the element, what does it return?

If the Dimix > than max elements in the dim then you have a subset name.

Re: Error while trying to build a Named Hierarchy in a TI process

Posted: Wed Jul 15, 2020 5:18 pm
by tm123
Hi guys,

It looks like Paul Simon has experienced the same issue, and I found something online regarding this.

He also provided a workaround, but before coming across his thread, I deleted the Dimension and re-created it. When i recreated the dimension, on the same time I did what Paul suggested and my issue is resolved. I hope that Paul's code has resolved my problem, and not the deletion of dimension

Here is the link with his thread:

https://community.ibm.com/community/use ... 4eda43146b

thanks