08-31-2022 12:21 PM - last edited on 05-02-2023 10:53 AM by JackLacava
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
09-01-2022 12:59 PM
I can confirm there seems to be an issue with the "TopMostMemberID".
I don't get " 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." when I test this, but I am getting the formula does not consider the "TopMostMemberID" and returns the FCP in another hierarchy. In my case, there are multiple hierarchies with these Entities.
I think this should be logged with support.
11-11-2022 11:13 AM
I was also having issues with the BRApi. When talking with a OS rep, he made a comment this was a known error and to use api instead. See below, these were my local variables but there is not difference between api and BRApi that I recall when I switched. I am using this for a Profit Center elimination and it instantly worked how I was expecting. Give this a shot.
Dim sFCP As Member = Api.Members.GetFirstCommonParent(oUD1DimPk,iUD1Top,iUD1Id,iUD5Id)