Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Breezy
Creator II
Creator II

Alternate row colors

Hi,

I have my headings as blue since "Frog" is chosen. And when "Frog" is not chosen, the table headings change to green:

=if([Frog/Bug]='Frog',RGB (30,144,255),RGB (124, 252,0))

 

However, I want my rows to alternate grey and light grey, regardless of if "Frog" is chosen or not. How do I make it look like below?

 

Frog

TableColors.JPG

10 Replies
stevejoyce
Specialist II
Specialist II

you can use background color expression:

=pick(mod(rowno(total ), 2) +1, rgb(color1), rgb(color2))

Breezy
Creator II
Creator II
Author

Thank you! Where do I type that in?

Also will that allow me to keep my first column and top row the colors I want?

stevejoyce
Specialist II
Specialist II

Are you using the native qlik sense pivot table?  if you expand your measure(s) you can set background color expression.

Native (Straight) table you'd put on your dimension(s) and measure(s).

 

Extensions, like the vizlib pivot have properties to set alternating row colors.

Breezy
Creator II
Creator II
Author

I was using the native table (not pivot table). I could use Vizlib instead though. I looked at it and could not find, in Vizlib, the part for alternating row colors.

stevejoyce
Specialist II
Specialist II

Vizlib straight table:

In Appearance > tick Background switch to "striped"

 

pivot:

Appearance > columns (Right) cells

set even/odd cells color.

 

You can add a table and choose from template which might help in the future trying to find some properties that are setup.

Breezy
Creator II
Creator II
Author

In the native table (not pivot or Vizlib) I'm going to 'appearance -> Columns (right) cells. There is no even/odd option though.

In appearance I also do not see an 'background' option either...

 

I did open a VizLib file for a brief moment to glance at the templates but they did not have what I am looking for.

stevejoyce
Specialist II
Specialist II

The alternate row option is only available in viz lib table/pivot table.

If you are using native table, go into each dimensoin/expression, and in the background color use the formula i posted

=pick(mod(rowno(total ), 2) +1, rgb(color1), rgb(color2))

 

stevejoyce_0-1633631256015.png

 

Breezy
Creator II
Creator II
Author

Thanks ! It's working -

However - how do I get that to show up in my 'null' cell as well? Apparently it only shows up in the cells with data.

stevejoyce
Specialist II
Specialist II

I don't believe that will be possible.  Same with Vizlib.  Vizlib has a property to color null cells, but it won't reflect the alternating background color.