Process: How to add new element and check in all hierarchies if exists?

Post Reply
kunbela
Posts: 5
Joined: Thu Feb 22, 2018 4:19 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2016

Process: How to add new element and check in all hierarchies if exists?

Post by kunbela »

Hi Everyone!

I am facing an issue regarding the new hierarchies.
I want to write a process, that adds a new element to a specific hierarchy, but before that I want to check, if that new element already exists in the hierarchy, or in any of the other hierarchies.

In the old times the DIMIX done its job perfectly, but now it is not enough.
Is there a DIMIXForAllhierarchy function? Becasue there should be. (I couldn't find it the documentation, just praying :D )

Is there a way to find out the number of the hierarchies and their names in a process? So I could create a loop and check in all with HierarchyElementExists?
In rules I found the HierarchyCount and HierarchyN, that would be perfect, but unfortunately they can be used in rules only. And not works in processes. (Extra beer for anyone who knows why)

Any tips beside to hardcode HierarchyElementExists for all known hierarchies?

Thanks for your help in advance.
Wim Gielis
MVP
Posts: 3233
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Process: How to add new element and check in all hierarchies if exists?

Post by Wim Gielis »

Hello,

In the documentation I see:

HierarchyElementExists( sDim, sHier, sEl );
ElementCount( sDim, sHier );

If it's an n-level element it will be part of the Leaves hierarchy of the dimension.

I see a dimension called }Hierarchies_organization for a dimension called organization:
0.PNG
0.PNG (5.36 KiB) Viewed 2074 times
The }Dimensions dimension contains elements like this:
2.PNG
2.PNG (32.79 KiB) Viewed 2074 times
And a folder structure on the hard drive:
1.PNG
1.PNG (7.34 KiB) Viewed 2074 times
As well as this topic of mine: viewtopic.php?f=21&t=14783

Plenty of options I would think ;-)
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
kunbela
Posts: 5
Joined: Thu Feb 22, 2018 4:19 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2016

Re: Process: How to add new element and check in all hierarchies if exists?

Post by kunbela »

Hi Wim,

Thank you for the quick response.

Unfortunately I can't use 'Leaves' hieararchy. N and C levels are using the same counter to generate new element IDs.

But this }Hierarchies_organization dimension is a really nice tip. I am gonna use it.
It would be nice, if a simple function would solve it (THAT EXISTS FOR RULES!?! :roll: ), and SUBST wouldn't needed, to get the hierarchy name. But at least it is dynamic.

Thanks again Wim!
Wim Gielis
MVP
Posts: 3233
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Process: How to add new element and check in all hierarchies if exists?

Post by Wim Gielis »

Hello,

Thanks for pointing me to the Hierarchy Rules Functions. They must be new !
https://www.ibm.com/support/knowledgece ... ions..html
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Post Reply