How can we apply conditional formatting for a parent member which has it's children members.

New Contributor

Dear Community, 
I have a requirement to apply conditional formatting for a parent member which has it's children members underneath it (eg., A#Cash.ChildrenInclusive). So, when I apply formatting, it automatically applies for it's children member too. 


Here, I have applied "ExcelTopBorder" cell formatting for the parent member and it got applied to all the children members too. 


Contributor III

Hi Radhika,

You can create two rows here , Row1 : A#Cash, Row2: A#Cash.Children, apply formatting only in Row 1.

Hope this helps.

Nidhi Mangtani

New Contributor III

Hi Radhika,

if you don't want to create separate rows, you could also use conditional formatting (e.g. using MemberName as filter).




Here is the XFBR BR code that you can use to call in XFBR function in the cube view


Namespace OneStream.BusinessRule.DashboardStringFunction.CV_Formatting
Public Class MainClass
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardStringFunctionArgs) As Object
If args.FunctionName.XFEqualsIgnoreCase("ParentBold") Then
'Not working when usd with |MFAccount|
Dim AccountFilter As String = args.NameValuePairs("cvAccount")
Dim AccDimPk As DimPk = BRApi.Finance.Dim.GetDimPk(si, "CorpAccounts")
Dim AncestorID As Integer = BRApi.Finance.Members.GetMemberId(si, DimTYpe.Account.Id, "TotAccount")
Dim BaseID As Integer = BRApi.Finance.Members.GetMemberId(si, DimTYpe.Account.Id, AccountFilter)

Dim isBase As Boolean = BRApi.Finance.Members.IsBase(si, AccDimPk, AncestorID, BaseID)

If Not isBase Then
'BRApi.ErrorLog.LogMessage(si, AccountFilter)
Return "Bold=True"
End If

Return Nothing
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
End Class
End Namespace

New Contributor II

Hi @Sridhar_M 

If |MFAccount| does not work, how do you pass this information to the XFBR? If for example, cube is organized in the way that Row shows A#Account.TreeDescendantsInclusive how would you adjust XFBR or how do you gather 'cvAccount' so that finally only Parent Member is bolded?


Hi @wJack 

I tried with the above code with |MFAccount| and it's not working. But to give you an example how to pass cvAccount to XFBR. Please see the example below. 

XFBR(CV_Formatting_Bold, ParentBold, cvAccount=[|MFAccount|])