Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

OBIEE 12c How can I alternate colors between 'groups' of rows?

Received Response
302
Views
7
Comments
Tom D
Tom D Rank 3 - Community Apprentice

In an analyses, I have the following scenario:












I would like groups of Record IDs to have a different background color.

The rows with Record ID = 1 & 3 would have a 'blue' background color.

The rows with Record ID = 2 would have a 'white' background color.

Answers

  • If you really want fixed colors you should look into conditional formatting, which will need to be set for all columns of your table view (even if using the same condition on "Record ID").

    If you just want alternate colors between rows, you should have a checkbox to enable the "zebra pattern".


  • Tom D
    Tom D Rank 3 - Community Apprentice

    Thank you Gianni. Yes I know about conditional formatting and "Enable alternate styling".

    The Records IDs will not be sequential, first group of Record IDs may be 31456, 2nd group 31499, and 3rd group 31809, as an example.

    If they were sequential, it would be easier to do the coloring via conditional formatting....

  • You could try to cheat with a ranking function on the Record IDs and use that as condition? Same Record IDs is supposed to have the same ranking, and it always start with 1.

  • Tom D
    Tom D Rank 3 - Community Apprentice

    Thank you. Got it to work with ranking.

  • Tom D
    Tom D Rank 3 - Community Apprentice

    on second thought, maybe I didn't get it working :)

    I do a rank(cast( pongo_id as integer)) in my column formula.

    And this is the output. Confused as to why it goes from 1 to 9, then from 9 to 17, and so on ?!?

    I would expect the id to be 2 where Pongo ID = 67473, and id to be 3 where Pongo ID = 67472.

    Any more help is appreciated.


  • Damn, I forgot that RANK is a RANK and not a DENSE_RANK.

    Dirty fix: use EVALUATE? If your source is a database, it must have a function doing ranking without skipping values in case of multiple with same ranking. That's what DENSE_RANK does in an Oracle Database.

  • Tom D
    Tom D Rank 3 - Community Apprentice

    Thank you for your help. I will give this a try.