Skip to main content
Newcomer
Feb 24, 2024 11:42 AM UTC
Solved

cube view formatting

I want format the Cube view cell based on cell amount

If (CellAmount > GetDataCell(CVC(Col2)) )Then
BackgroundColor = Red, TextColor = White
End if

This code is not working, Actually I am comparing actual amount with budget.

how can we do this?

 

Employee - Sage
Feb 26, 2024 10:25 AM UTC

GetDataCell belongs to member filters, it cannot be used in Conditional Formatting statements.

Conditional Formatting rules can only look at the Cell contents and View Headers. So what you can do in your case is the following:

  1. create a new Column. As Member Filter, use GetDataCell to calculate the difference, e.g. GetDataCell(CVC(Col1) -CVC(Col2)):Name(Difference)
  2. On that column, apply a conditional format, e.g.
If (CellAmount > 0) Then 
    BackgroundColor=Red, TextColor=White
End If

If you don't want to show the number, simply set TextColor to the same as BackgoundColor (but note the number might leak anyway, when exported as Report or Excel), or play with number formatting to round it 0/1.

1 reply

Employee - Sage
Feb 26, 2024 10:25 AM UTC

GetDataCell belongs to member filters, it cannot be used in Conditional Formatting statements.

Conditional Formatting rules can only look at the Cell contents and View Headers. So what you can do in your case is the following:

  1. create a new Column. As Member Filter, use GetDataCell to calculate the difference, e.g. GetDataCell(CVC(Col1) -CVC(Col2)):Name(Difference)
  2. On that column, apply a conditional format, e.g.
If (CellAmount > 0) Then 
    BackgroundColor=Red, TextColor=White
End If

If you don't want to show the number, simply set TextColor to the same as BackgoundColor (but note the number might leak anyway, when exported as Report or Excel), or play with number formatting to round it 0/1.