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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
techvarun
Specialist II
Specialist II

Conditional Color Change on Bar Chart

Hi All,

                  I have a bar chart as Market as dimentions and sum(sales) as expression and I have one more list box called Market Name.

   My requirement is if i check 5 on list box only 5 should highlighted with some different color or bold,

I have managed to change the color of all markets but not the particular one.

if(GetFieldSelections([Market Name])= '5', Green())

in this case only 5 should display as green and not all the markets

Color Code.png

Thanks

Varun

7 Replies
sujeetsingh
Master III
Master III

Right this on the Expression background colour attribute

techvarun
Specialist II
Specialist II
Author

Hi Sujeet

                  Thanks for ur reply.

my requirement is if select 5 on list box only five get highlighted on bar chart Y axis

Thanks

Varun

tresesco
MVP
MVP

Use expression like:

=Sum({<[Market Name]>} Sales)

And then your expression if(GetFieldSelections([Market Name])= '5', Green()) should work the way you want.

Edit: Corrected field name

techvarun
Specialist II
Specialist II
Author

Hello Tresco,

Thanks for ur reply

color code data model.png

PFA data model.

Bar chart and list box don't have any link.

Thanks

Varun

tresesco
MVP
MVP

In that case, it should work without that set expression inclusion. Can you share a sample qvw that demonstrates the issue?

techvarun
Specialist II
Specialist II
Author

Please find the attached qvw

tresesco
MVP
MVP

I tried with background color.

Exp: If([Market Name]=1 and Market=1, Red(), Green())

You have to modify accordingly.

PFA

Update: to make it dynamic use something like:  If([Market Name]= Market, Red(), Green())