Page 1 of 1

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

Posted: Sun Nov 08, 2020 9:09 pm
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.

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

Posted: Sun Nov 08, 2020 10:29 pm
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 2078 times
The }Dimensions dimension contains elements like this:
2.PNG
2.PNG (32.79 KiB) Viewed 2078 times
And a folder structure on the hard drive:
1.PNG
1.PNG (7.34 KiB) Viewed 2078 times
As well as this topic of mine: viewtopic.php?f=21&t=14783

Plenty of options I would think ;-)

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

Posted: Sun Nov 08, 2020 10:45 pm
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!

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

Posted: Sun Nov 08, 2020 11:15 pm
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