Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

highlight a cell based on another cell in crosstab

Hi Gurus,

I am trying to highlight the background color of a cell based on another cell.

Scenario below:

1. if a fieldx value = 0, then, highlight the whole crosstab row in Maroon

2. no background color in first column of crosstab

3. if the cell value in crosstab column 2 or column 3  belongs to a string of values, then, highlight the value in column 2 or column 3 as Green.

4. If the cell value in crosstab column 2 or column 3 belongs to a string of values, then highlight the value(s) in any of the columns beyond column 3 , that belongs to a string of values, in Blue.

5. If the cell value in crosstab column 2 or column 3  does not belongs to a string of values, then highlight the value(s) in any of the columns beyond column 3, belongs to a string of values, in Red.

--

Local ITEM

ITEM = TRIM(mid(CurrentFieldValue,3))

if GridRowColumnValue ("@Table.Fieldx") = 0 then

formula = crMaroon

else

      if GridRowColumnValue ("Table.crosstabcolumn")=1 then

    formula = crNoColor

    else

          if instr({StringX},ITEM)=0 then

          formula = crNoColor

          else

              if instr({StringX},ITEM) <> 0 then

                    if GridRowColumnValue ("Table.crosstabcolumn")=2 then

                    formula = crGreen

                    else

                        if GridRowColumnValue ("Table.crosstabcolumn") > 3 then

                        formula = crBlue

                    if GridRowColumnValue ("Table.crosstabcolumn") > 3 then

                    formula = crRed

                    End if

              End if

          End if

    End if

End if

----------

Gurus,

I am unable to highlight blue and red colors correctly

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question