Skip to main content
February 24, 2024
Solved

cube view formatting

  • February 24, 2024
  • 1 reply
  • 0 views

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?

 

Best answer by JackLacava

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

February 26, 2024

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.