First Common Parent
Hi all, I am building a cube view for my end users to tell them the first common parent of two entities based on parameter inputs. However, I am having trouble with the BRApi.Finance.Members.GetFirstCommonParent formula as used in a Dashboard XFBR String.
Here is the formula at prompt:
BRApi.Finance.Members.GetFirstCommonParent(si, dimPk, topMostMemberId, memberIdA, memberIdB, dimDisplayOptions)
The input for "topMostMemberId" seems to dominate the return value of the formula. If I put our top most entity hierarchy memberId into the input, the formula will return that value, even if it is not the first common parent. If tried a number of different inputs here, all of them seems to just spit out on the return.
What am I missing? Is there something in the dimDisplayOptions I need to toggle?
Here is my VBA:
If args.FunctionName.XFEqualsIgnoreCase("GFCP") Then
Dim EntityInputName1 As String = args.NameValuePairs.XFGetValue("Entity1")
Dim EntityInputName2 As String = args.NameValuePairs.XFGetValue("Entity2")
Dim EntityInputId1 As Integer = BRApi.Finance.Members.GetMemberId(si,0,EntityInputName1) '0 = corpentity
Dim EntityInputId2 As Integer = BRApi.Finance.Members.GetMemberId(si,0,EntityInputName2) '0 = corpentity
Dim entityDimPk As DimPk = BRApi.Finance.Dim.GetDimPk(si, "CorpEntity")
Dim TopParentID As Integer = BRApi.Finance.Members.GetMemberId(si, entityDimPk.DimTypeId, "All_Entities") 'Top of hiearchy
Dim mbr As Member = BRApi.Finance.Members.GetFirstCommonParent(si, entityDimPk, TopParentID, EntityInputId1, EntityInputId2)
Return mbr.Name