Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Learnerr
Contributor III
Contributor III

Comparing Tables with Colors

Hi experts,

 

I would like to compare   yeears' sellings for months.

For example i am going to choose January and want to see in this table how was it like in 2021 and 2022.

Also ı  would like to compare the values with colors.

I mean if 2022 january> 2021 January make the related column green.

 

How can i do that comparision analysis?

Best Regards.

 

Learnerr_0-1654255199104.png

 

1 Solution

Accepted Solutions
Marijn
Creator II
Creator II

Hi @Learnerr,

It would be possible to achieve this with the month and a valuelist for the years as dimensions.

Dimension 1:
=valuelist(2021,2020)

Dimension 2:
=Month

Expression:

if(valuelist(2021,2020)=2021,
   sum( {$< Year={2021}>} sales),
if valuelist(2021,2020)=2020,
   sum( {$< Year={2020}>} sales)
))

Then right click on the expression column in the table, and click 'Custom format cell'. Click on 'Background color', then 'Calculated' and use the expression:
if( sum( {$< Year={2021}>} sales) > sum( {$< Year={2020}>} sales),green() )

Hope it helps!

View solution in original post

1 Reply
Marijn
Creator II
Creator II

Hi @Learnerr,

It would be possible to achieve this with the month and a valuelist for the years as dimensions.

Dimension 1:
=valuelist(2021,2020)

Dimension 2:
=Month

Expression:

if(valuelist(2021,2020)=2021,
   sum( {$< Year={2021}>} sales),
if valuelist(2021,2020)=2020,
   sum( {$< Year={2020}>} sales)
))

Then right click on the expression column in the table, and click 'Custom format cell'. Click on 'Background color', then 'Calculated' and use the expression:
if( sum( {$< Year={2021}>} sales) > sum( {$< Year={2020}>} sales),green() )

Hope it helps!