Return the parent member using XFGetHierarchyProperty function

AndreaF
Contributor III
Hi,
 
I am trying to use the XFGetHierarchyProperty Spreadsheet function to return the "Parent member name" property of a member.
 
I tested the function by returning the HasChildren property and that is working fine.
AndreaF_0-1678971395860.jpeg

 

However, how do I return the "Parent member name" property? Is that possible and what should I use as property string in the function? (the one below is not working and returns an error as you can see)
AndreaF_1-1678971395860.jpeg

 

Thank you

1 ACCEPTED SOLUTION

AndreaF
Contributor III

Thank you for your reply. Since the parent member is a relationship property, looking at the XFGetRelationshipProperty function probably makes more sense. However, as you pointed out a member can have multiple parents. Looking in the dimension library I believe the properties that are greyed out can be used to identify the relationship, but cannot be retrieve using the XFGetRelationshipProperty function, while what is not greyed out can be retrieved with the XFGetRelationshipProperty function.

AndreaF_1-1679061043370.png

 

 

View solution in original post

6 REPLIES 6

JackLacava
Community Manager
Community Manager

From documentation:

This function determines whether or not a Dimension has children and returns True or False

XFGetHierarchyProperty(“DimTypeName”,”DimName”,“MemberName or Script”,“PropertyName”,”PrimaryCubeName”,”ScenarioTypeNameForMembers”,
”MergeMembersfromReferencedCubes”)

Example: Retrieving Child  Hierarchy
XFGetHierarchyProperty("entity","HoustonEntities","Houston Heights","HasChildren","Houston","Actual",FALSE)

There is no mention of parents. I would argue returning a parent would be difficult, because any member can have multiple ones in a hierarchy.

AndreaF
Contributor III

Thank you for your reply. Since the parent member is a relationship property, looking at the XFGetRelationshipProperty function probably makes more sense. However, as you pointed out a member can have multiple parents. Looking in the dimension library I believe the properties that are greyed out can be used to identify the relationship, but cannot be retrieve using the XFGetRelationshipProperty function, while what is not greyed out can be retrieved with the XFGetRelationshipProperty function.

AndreaF_1-1679061043370.png

 

 

Sridhar_M
Contributor

There is a function called "Parents" in Member Filter Builder. You can use that to retrieve parents. 

Syntax would be like this: 

MyMember.Parents

 

sridharm92_1-1679277553604.png

 

That would return the Parents of a member, but I don't think I would be able to use it for my purpose, which is having a list of all members from a dimension and their parent next to it.

kmd
Contributor

This should be something for the IdeaStream for sure!  I have had similar requests from our users.  Realize that there is the possibility of having multiple results but perhaps OneStream could create an XF function where one of the arguments is the individual hierarchy parent.  The only other way I can think of to try to make this happen is to use one of the Text fields for the member to identify it's parent and then pull that but again that can be a LOT of manual effort.

tdugas
New Contributor III

I would like to do the same.