DIMIX check for element in a Hierarchy enabled dimension

Post Reply
lav4you
Posts: 48
Joined: Fri Jan 02, 2009 1:20 pm

DIMIX check for element in a Hierarchy enabled dimension

Post 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
User avatar
gtonkin
MVP
Posts: 1192
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: DIMIX check for element in a Hierarchy enabled dimension

Post 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.
lav4you
Posts: 48
Joined: Fri Jan 02, 2009 1:20 pm

Re: DIMIX check for element in a Hierarchy enabled dimension

Post 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..
ascheevel
Community Contributor
Posts: 286
Joined: Fri Feb 15, 2013 5:49 pm
OLAP Product: TM1
Version: PA 2.0.9.1
Excel Version: 365
Location: Minneapolis, USA

Re: DIMIX check for element in a Hierarchy enabled dimension

Post 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.
lotsaram
MVP
Posts: 3651
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: DIMIX check for element in a Hierarchy enabled dimension

Post 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)
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Post Reply