Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Britty2117
Contributor
Contributor

Color by Expression with 2 measures in bar chart

Hello, 

I have 2 measures in a bar chart to show a 2018 VS 2019 chart. I want to set 2018 to be one color and 2019 to be a different color. 

I have tried: 

=if(sum({$<[Move Date]={">=01/01/2018 and <=08/31/2018"}>}[Profit]),
rgb(35,175,130),
if(sum({$<[Move Date]={">=01/01/2019 and <=08/31/2019"}>}[Profit]), rgb(230,0,80)
)
)

but i get a chart that is all green. 

 

I have tried: 

=if([Move Date.autoCalendar.Date]>='01/01/2019', rgb(35,175,130), if([Move Date.autoCalendar.Date]<='12/31/2018', rgb(230,0,80)))

 

and the whole chart is grey. 

Please let me know how i can get each year to show as a different color. 

clipboard_image_0.png

1 Reply
agigliotti
Partner - Champion
Partner - Champion

i guess you should use a combo chart with 2 measures to achieve it.