Skip to main content
Announcements
Get Ready. A New Qlik Learning Experience is Coming February 17! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Alternate colors in Pivot table

Hi All,

We are having a requirement to show alternate colors in Pivot Table based on Submission ID.

  If Submission ID "2" is given blue then next Submission ID "3" should "yellow" then again for 5 it should be blue and for 7 it should be yellow.

I have attached a sample QVW with this. Please let me know if you need any more information.

Thanks,

Sijo

12 Replies
mato32188
Specialist
Specialist

Hi Sijo,

how is you color calculated? ...if Submission ID "2" is blue... Submission ID "2" is blue, because ...

BR

M

ECG line chart is the most important visualization in your life.
morganaaron
Specialist
Specialist

Stick this into the "Background Color" definitions for just the expression or expression + dimension if needed:

if(Match([Submission ID],'2','5'), LightBlue(100), Yellow())

You can change the alpha value of the blue, or enter RGB codes if that's more what you want. If you go any darker with the blue I'd also recommend changing the text colour using the same expression to White().

rajeshvaswani77
Specialist III
Specialist III

Try this in your background expression.

IF(Even(RowNo(TOTAL)),Yellow(),Blue())

thanks,

Rajesh Vaswani

emkabi646
Partner - Contributor II
Partner - Contributor II

Hi Sijo,

see the background-Color definition in the sample-file.

The Match-function from Aaron is the more elegant solution.

Regards

Martin

Not applicable
Author

The value's we put 2,5,7 just dummy values. It can be any values from 1..10000.

We need to color when the submission changes from the previous one.

Thanks,

Sijo

mato32188
Specialist
Specialist

Fine, but very first color in your order is based on some calculation? Like if amount for Submission ID2 is under 300, get blue?

ECG line chart is the most important visualization in your life.
rajeshvaswani77
Specialist III
Specialist III

So its alternate colouring right?

Not applicable
Author

Hi,

If its about the assigning the colour on the basis of Odd and Even Submission IDs then;

      Expression->Background Colour -> if(Even(SubmissionID),Blue(),Yellow())

Hope it helps !

Cheers !

Not applicable
Author

yes