IBM Business Analytics

 View Only
Expand all | Collapse all

Alternate row colors in Cognos Dashboard - List object

  • 1.  Alternate row colors in Cognos Dashboard - List object

    Posted Tue December 27, 2022 09:31 AM
    Hi Team,

    Could you please share, how to implement, alternate row colors in Cognos Dashboard - List object.

    Thanks

    ------------------------------
    Madhava Palleboina
    ------------------------------


  • 2.  RE: Alternate row colors in Cognos Dashboard - List object

    Posted Tue February 21, 2023 04:47 PM

    Try attributing your data with a column that alternates between 1 and 0.  This can be accomplished by finding, or creating a value that is unique for each resulting row in your result set.  Start by adding a calculated column using RUNNING-COUNT(YOURUNIQUEFIELD) and name it "Running Count".  Then add a calculated column using MOD(RUNNING-COUNT(YOURUNIQUEFIELD),2) and name it "Mod".  It will look something like this:

    Then in your report page, add a conditional style for the list that formats the way you want when the Mod = 0 or 1.  Make sure that you sort the list according to the Running Count column or else you may end up with two consecutive rows that have the same formatting due to them both having the same value for Mod.



    ------------------------------
    Logan Whitaker
    ------------------------------