Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Alternate colour in table based on value

I would like to alternate the colours in a table based on the first column which contains a number as these lines belong logically together.

Pty

Col2

Col3

2

2

3

9

9

12

12

12

33

The background colour should be alternating between two colours to indicate which rows belong together.

So even/odd row is not working. Checking, if the previous row has another value than the current value using Above(field,1) does not work, because I need to toggle between two colours and cannot take a color based on the check.

Any idea how I can solve this problem?

Thanks

5 Replies
Not applicable

Re: Alternate colour in table based on value

Hi Blappurs,

sorry to bother you.

Could you tell me how did you color alternative rows by using even/odd concept? did you use any Extension for this?

Not applicable

Re: Alternate colour in table based on value

Alternate colouring can be achieved for columns using a background expression:

  if(Even(RowNo(TOTAL)), rgb(219,219,219), rgb(255,255,255))

(background expression is only available for "Measure" columns in QlikSense).

As said before, this does not help in my case.

Regards

Urs

Not applicable

Re: Alternate colour in table based on value

At first, Thank you for your reply.

Exactly, It applies to only Measures column, Not for dimensions in Pivot table. Even in Table view we don't have a option to provide background color for dimesnsions.

Thank you for your time.

Not applicable

Re: Alternate colour in table based on value

I think we can solve your issue by defining the colors at script and assigning them in UI Level. I attached sample application for you.

Hope it helps.

Not applicable

Re: Alternate colour in table based on value

Thanks for your time.

This does not work in my case, because the a certain row might be missing due to a different selection, but the coloring should still be alternating. In my example table, I cannot assign a colour to a value (example 9 = grey), because another selection might make row value 3 not appear and then the value 9 should be coloured white because it would adjust to 2 which is already grey. I need a mechanism like:

  if ((Above(col1,1)<> col1), toggleColor(), keepColor())

But how can I implement this in QlikSense?

Community Browser