Member Constraints

ZAH
New Contributor

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 

9 REPLIES 9

NicolasArgente
Valued Contributor

Hi ZAH,

Sorry, you are on the right track... have you tried passing the argument of FlowConstraint?

Connect with me on:
LinkedIn: https://www.linkedin.com/in/nicolas-argente/
Website: https://aiqos.io
If you want to lift yourself up, lift up someone else.

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 .

NicolasArgente
Valued Contributor

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!

Connect with me on:
LinkedIn: https://www.linkedin.com/in/nicolas-argente/
Website: https://aiqos.io
If you want to lift yourself up, lift up someone else.

@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.

OS_Pizza_0-1670335257155.png

OS_Pizza_1-1670335269098.png

 

NicolasArgente
Valued Contributor

Or another easy way could be to code it in a text field?

Connect with me on:
LinkedIn: https://www.linkedin.com/in/nicolas-argente/
Website: https://aiqos.io
If you want to lift yourself up, lift up someone else.

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

NicolasArgente
Valued Contributor

Sounds like a solution then... let me look for it!

Connect with me on:
LinkedIn: https://www.linkedin.com/in/nicolas-argente/
Website: https://aiqos.io
If you want to lift yourself up, lift up someone else.

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.

Thanks,
Nidhi Mangtani

NicolasArgente
Valued Contributor

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

Connect with me on:
LinkedIn: https://www.linkedin.com/in/nicolas-argente/
Website: https://aiqos.io
If you want to lift yourself up, lift up someone else.