09-05-2022 09:10 AM - last edited on 05-24-2023 12:12 PM by JackLacava
Hello all .
i am trying to display in a cubeview a list of accounts with specific constraints related to FLow , for example i want to display Only accounts with having Flow = EQU . any idea which function to use ? i tried the [Where] clause
it didnt work out. would the [Option] be helpful ? which arguments should i pass
09-05-2022 11:09 AM - edited 09-05-2022 11:13 AM
Hi ZAH,
Sorry, you are on the right track... have you tried passing the argument of FlowConstraint?
09-05-2022 11:17 AM
Hello Nicolas,
i tried this: A#M_BS.Base:Name(XFMemberProperty(DimType=Account, Member=|MFAccount|, Property=FlowConstraint)
it displays the flowconstraint for all BS accounts . i want to be able to select Accounts having EQU flow only . in sql it is very easy. but in OS i having difficulty finding the correct function to pass such a filter on .
09-05-2022 11:21 AM
It might be easier if you use an XFBR formula. Do you need the indentation in your cube view? as you will loose that by default in the XFBR!
12-06-2022 09:03 AM
@NicolasArgente I am using the below formulae to fetch members in a cube view.
Account -> A#Root.CustomMemberList(BRName= abc,Param1=value1)
The results from BR defaults the indentation to 0 instead of the indentation that is mentioned in the formatting tab.
Do you know how we can change the indent level to 3 after the members get returned from BR.
09-05-2022 11:23 AM
Or another easy way could be to code it in a text field?
09-05-2022 11:26 AM
Can i find it somewhere? (BR Formula)i am still new to the OS world . no indentation is not needed . my cube will be for Data Entry purposes only
09-05-2022 11:29 AM
Sounds like a solution then... let me look for it!
09-05-2022 11:33 AM - edited 09-05-2022 11:34 AM
Hi,
Please try this in your cube view.
A#M_BS.Base.Where((XFMemberProperty(DimType=Account, Member=|MFAccount|, Property=FlowConstraint) = EQU)
Let us know if this works.
09-05-2022 11:39 AM - edited 09-05-2022 11:40 AM
You would do something like this into a Dashboard XFBR String :
If (args.FunctionName.XFEqualsIgnoreCase("GetFlowConstraints")) Then
' Return Me.GetFlowConstraints(si, globals, api, args)\
And then the formula could be :
Public Function GetFlowConstraints(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardStringFunctionArgs) As String
Try
'Get the Dim PK for Accounts Dimension
Dim AccountsDimPk As DimPk = BRApi.Finance.Dim.GetDimPk(si,"DIMAccount")
'Get the member name of the account
'Get a list of BS accounts
Dim memFilterAccounts As List(Of MemberInfo) = BRAPi.Finance.Members.GetMembersUsingFilter(si, AccountsDimPk, "A#BS.Base.Where(InUse = True)", True)
'Use a text builder to build a string
Dim acMemberList As New Text.Stringbuilder()
' Dim isfirstItem As Boolean = True
'Loop through the assigned accounts and return the first account in the list
For Each account As MemberInfo In memFilterAccounts
' If Not isfirstItem Then
Dim accountConstraints As String = BRApi.Finance.Account.GetConstraintMemberForDimType(si,account.Member.MemberId,dimTypeid.Flow,-1).ToString
Dim selectedConstraint As String = args.NameValuePairs.XFGetValue("FlowTable").ToString
If accountConstraints = selectedConstraint Then
' Else
acMemberList.Append("A#")
acMemberList.Append(account.Member.Name)
' End If
' isfirstItem = False
End If
Next
'log
'Brapi.errorlog.LogMessage(si,acMemberList.ToString)
Return acMemberList.ToString
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
tbh i have not tested 🙂
And you can read that too : https://community.onestreamsoftware.com/t5/Accepted-Code-Samples/Dashboard-XFBR-String/ta-p/6611