Page 1 of 1

DIMIX check for element in a Hierarchy enabled dimension

Posted: Mon Apr 11, 2022 2:43 pm
by lav4you
Hi Guys,

I am facing a problem which I would like to check this with the experts here.

I have dimension name Project which uses Hierarchy feature. It also includes a 'Leaves' hierarchy which is auto updated by PA.

I have one element name 'FF123' which exist in Leaves hierarchy but not in main which is Project>Project.

When I apply DIMIX rule in a cube to detect whether element is an existing element in a dimension or not it returns 0 confirming not an existing element.

Honestly I am surprised to see this result, my assumption is DIMIX will scan entire dimension and all hierarchies within that dimension since DIMIX is not a hierarchy aware function and it will see the entire dimension.

Is my assumption wrong? what is a scope of DIMIX in a hierarchy enabled world of PA?

DIMIX details on PA Documentation: https://www.ibm.com/docs/en/planning-an ... irf-dimix

Is it a bug?

Is there any other function to check existence of an element in entire dimension through a rule?


Regards,

Lav

Re: DIMIX check for element in a Hierarchy enabled dimension

Posted: Mon Apr 11, 2022 3:14 pm
by gtonkin
Don't think DimensionElementExists works in rules yet.

Hard to comment without seeing the rule being applied but expecting you to reference using 'Project:Leaves' in your DIMIX.

Re: DIMIX check for element in a Hierarchy enabled dimension

Posted: Mon Apr 11, 2022 3:21 pm
by lav4you
The Rule is simple

['Existing'] = S: IF (
DIMIX('Project', DB('User Input Check', 'New Project', 'String'))>0,
'Existing',
'New');


Further DImensionElementExist is a TI function not available for cube rules..

Re: DIMIX check for element in a Hierarchy enabled dimension

Posted: Mon Apr 11, 2022 4:08 pm
by ascheevel
The original functions can be used against hierarchies, but not specifying a hierarchy doesn't magically make the function a super function that can check all hierarchies. It's my understanding that if you don't make the function hierarchy specific, the function will generally apply to the main hierarchy which is the hierarchy that shares the same name as the dim. In your example, DIMIX is working as intended as you stated the element only exists in the leaves hierarchy of the Project dim and not Project hierarchy of the Project dim.

this should work for your example:

Code: Select all

['Existing'] = S: 
	IF(DIMIX('Project:Leaves', DB('User Input Check', 'New Project', 'String'))>0,
		'Existing',
	'New');
this also should work:

Code: Select all

['Existing'] = S:
	IF(ElementIndex('Project', 'Leaves', DB('User Input Check', 'New Project', 'String'))>0,
		'Existing',
	'New');
You mentioned the leaves hierarchy is auto-updated from PA, why aren't you adding the new leaf element to other hierarchies at the same time? I get that you may want different consolidations across hierarchies, but my opinion is that all leaf elements should be represented across all hierarchies of a dim.

Re: DIMIX check for element in a Hierarchy enabled dimension

Posted: Tue Apr 12, 2022 11:11 am
by lotsaram
lav4you wrote: Mon Apr 11, 2022 2:43 pm my assumption is DIMIX will scan entire dimension and all hierarchies within that dimension since DIMIX is not a hierarchy aware function and it will see the entire dimension.

Is my assumption wrong?
Yes your assumption is wrong. The old functions see only the "same named hierarchy". They do not scan all hierarchies.

DIMIX('Project', vEle)
==
ElementIndex('Project', 'Project', vEle)