08-12-2024 09:55 AM - edited 08-12-2024 09:56 AM
I am trying to figure out conditional formatting in a cube view to show base level members as different color.
For example, in a cube view- I have a row A#NETINC_INT.Tree, I would like to display Net Income base members and their data in different color.
08-13-2024 10:09 AM
Unfortunately, I do not think there is a way to do this but I'd welcome someone to prove me wrong. There is no 'HasChildren' or 'IsBase' option within Conditional Formatting. There is also no way to use an XFBR to generate the Cell Format because the |MFAccount| substitutional variable will not resolve there (only will resolve in a Member Filter).
This is a perhaps a good one for IdeaStream.
08-13-2024 01:56 PM
Hi ST1: here's our version of conditional formatting for base accounts.
This is a Dashboard XFBR String business rule named: XFBR_FormattingHelper
If args.FunctionName.XFEqualsIgnoreCase("InAccountIsBase") Then
'2023-12-19 | D.B. | Create a giant list to compare against for conditional formatting checks
'Usage: In Cube View Conditional Formatting
'Usage Example: If (RowE1MemberName In XFBR(XFBR_FormattingHelper, InAccountIsBase, TopAccount=[TopAccountOfHierarchy])) Then
Dim topAccount As String = args.NameValuePairs.XFGetValue("TopAccount")
Dim accountId As Integer = BRApi.Finance.Members.GetMemberId(si, DimType.Account.Id, topAccount)
Dim baseMembers As List(Of Member) = BRApi.Finance.Members.GetBaseMembers(si, BRApi.Finance.Dim.GetDimPk(si, "AllAccounts"), accountId)
Dim strBaseMembers As String = "'" + String.Join("','", baseMembers.Select(Function(x) x.Name)) + "'"
Return strBaseMembers
End If
Note! you need to modify the piece in red to your application.
A real-world example of usage to apply the conditional formatting (per my application/dimension/member names). This is in a Header Format of a row that contains a A#IncomeStatement.Tree expansion
If (RowE1MemberName In XFBR(XFBR_FormattingHelper, InAccountIsBase, TopAccount=[IncomeStatement])) Then
TextColor = Red
End If
Cheers, -db
08-13-2024 02:18 PM
Nice one!