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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
jerryr125
Creator III
Creator III

Color a Bar in a chart a specific color

Hi - 

I have a bar chart displaying two different bars for each month:

Bar #1 Expression:

Sum({$<[ACCOUNTTYPEID]={'A'}>} ACCOUNTAMOUNT)

 

Bar #2 Expression:

Sum({$<[ACCOUNTTYPEID]={'B'}>} ACCOUNTAMOUNT)

 

I have the colors set 'by expression' with the following formula:

 

IF([ACCOUNTTYPEID]='A',rgb(0,109,51),rgb(186,18,0))

 

It does not work - colors all bars rgb(186,18,0) 

 

thoughts ? Jerry

 

 

 

 

 

1 Solution

Accepted Solutions
Kushal_Chawda

You can create the master measure for both the expression and in the property of master measure you can set the color . Now If you create the Bar chart with master measure it will automatically color the bar .

Capture.JPG

View solution in original post

3 Replies
Kushal_Chawda

You can create the master measure for both the expression and in the property of master measure you can set the color . Now If you create the Bar chart with master measure it will automatically color the bar .

Capture.JPG

dwforest
Specialist II
Specialist II

This doesn't work because your graph does not use ACCOUNTTYPEID as dimension.

If you set ACCOUNTTYPEID as a dimension, the measure would just be SUM(ACCOUNTAMOUNT) and then your color code would work

jerryr125
Creator III
Creator III
Author

correct - the funny thing is I had this already in the application - I added new data with new field names so therefore my master measure did now work!  All is good now - thank you for the reminder! Jerry