Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rish
Contributor III
Contributor III

Bar graph colour expression not working

I am using an expression as a dimension in a bar graph which is kinda like this:

IF(FIELD1 = FIELD2, 1,0)

And I am using the following expression in the color expression:

IF(FIELD1 = FIELD2, '#colorcode1','#colorcode2')

The bar graph shows 2 distict bars properly so I can say the dimension expression is working,  but for some reason the color expression isnt and seems to be treating all values as not equal and returning colorcode2 only, resulting in 2 bars representing different data but with same color. 

I created a column in data manager using the dimension expression, and when i use that field as dimension and in color expression the colors work fine.

Is there any way i can make this work without creating a field in the data manager?

1 Reply
Yoshidaqlik
Creator II
Creator II

Hi

I think it might work if you use a count

IF(COUNT(IF(FIELD1 = FIELD2,1))>0, '#colorcode1','#colorcode2')

Regards 

YoshidaQlik https://www.youtube.com/channel/UC1I9P8MqCZEhB6Nw3FdSqng