cancel
Showing results for 
Search instead for 
Did you mean: 

How to read a parent of a dimension

former_member200572
Participant
0 Kudos

Hi!

I need to read a parent from an dimension. I tried use SELECT as follow:

*SELECT(%V_HIER_COST_CENTER%,"[PARENTH1]",COST_CENTER,"[ID]=%COST_CENTER_SET%"), but does not work because PARENTH1 is not an atribute from COST_CENTER. This field, PARENTH1, is part of a hierachy structure.

E.g.

I have a hierarchy like this:


COST_CENTER      PARENTH1
10001            10000
10002            10000
10003            10000

I received 10001 in a parameter COST_CENTER (*XDIM_MEMBERSET COST_CENTER=%COST_CENTER_SET%) in my script logic. I need read the parent node 10000.

I just need to know the statement to read the parent node of a dimension.

Someone can help me?

Thanks in advanced.

Rafael

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Have you tried referencing the property HIR?

Parenth1 would be H1.

former_member200572
Participant
0 Kudos

Hi David.

I´d tried use a stetament like you mention but it returns the main parent (H1) not the value of this parent.

thanks.

Former Member
0 Kudos

Hi!

I need to read a parent from an dimension. I tried use SELECT as follow:

*SELECT(%V_HIER_COST_CENTER%,"PARENTH1",COST_CENTER,"ID=%COST_CENTER_SET%"), but does not work because PARENTH1 is not an atribute from COST_CENTER. This field, PARENTH1, is part of a hierachy structure.

E.g.

I have a hierarchy like this:

==========================================================

Hi,

Why don't you make a new field that represents PARENTH1? You may think it is redundant, but it is only way to make it recognized by *SELECT statement. It could be meaningful since I have a customer who has costcenter does not belong to its parent from collecting data, therefore we made collection field. It is fully relevant who can collect data because of people or system or regional distance, therefore it did perfectly make sense to have the field to represent data collection. In this case, if you make a field that represents parentH1, the statement you have does perfectly make sense.

Hope this helps,

YH Seo

former_member200572
Participant
0 Kudos

YH Seo,

I understood your point of view but is not exactly that I need. My main issue is read an hierarchy of a dimension. The COST_CENTER is just an example.

I have a parameter value and consequently its master data. In this master data I have attributes and hierarchies. I know what I can do to read an attribute but how can I read a parent field of a dimension?

I need to read this parent to use in a LOOKUP statement and all values are dynamics.

Thanks.

Former Member
0 Kudos

Rafeal,

Can you try creating one more property say "PARENT" copy the entire PARENTH1 column and try:

*SELECT(%V_HIER_COST_CENTER%,"PARENT",COST_CENTER,"ID=%COST_CENTER_SET%")

Not sure about other requirements..........Just a thought to share.

Thanks

former_member200572
Participant
0 Kudos

Hi Rushendra.

I have already done exactly like your suggestion but unfortunately it is not work.

Thanks.

Former Member
0 Kudos

Hi,

The MDX syntax to get the parent of a member is

[DimName].CurrentMember.Parent

You can use the above syntax.

Hope this helps.

Former Member
0 Kudos

Hi,

Can you please explain the requirement, as in why do you need to read the parent? How does your script look like, now?

May be we can try to help you, then. There are various ways to read the value from the parent. But the requirement will help to understand which way should be used.

former_member200572
Participant
0 Kudos

Nilanjan.

I am in the appl "B" and I need execute a LOOKUP in an appl "A". The company code dimension of appl "A" has a parent that a need to get the all member of appl "B" dimension. Something like this:


*SELECT(%V_COMPCODE%,"[PARENT]",COMP_CODE,"[ID]=%COMP_CODE_SET%")

*LOOKUP A
*FOR %V_PARENT% = %V_COMPCODE%
*DIM XXX:PLANT=%V_PARENT%
*NEXT
*ENDLOOKUP
....

If this code works, it would be exactly what I need.

The structure of these dimension is something like this:

Application "B" (when I executed the SELECT statement)

COMP_CODE.ID = A001, COMP_CODE.PARENTH1 = A001_ALL

Application "A" (when I executed the LOOKUP statement)

PLANT.ID = AA01, PLANT.PARENTH1 = A001_ALL

So I need to get parenth1 "A001_ALL" from COMP_CODE to get all members of PLANT with parenth1 value "A001_ALL" too.

I´ve already solve this but with a hard code parent.

Thanks.

Former Member
0 Kudos

Hi,

You can just use [COST_CENTER].[10000] in your logic to refer to the member.

Hope this helps.

former_member200572
Participant
0 Kudos

Nilanjan

I need a dynamic logic because the COST_CENTER is a parameter not a hard code, so I really don´t know its parent in the hierarchy.

Thanks.