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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional colouring of barchart

I use this expression

 

count(if(ANMAAR='2013',JOURNALNR))

and would like to set a condition than the bar turns red if the count is greater than 2013????????

something like this

count(if(ANMAAR='2013' and ANMAAR > '2012',JOURNALNR))

1 Solution

Accepted Solutions
Not applicable
Author

solved by using Background Color and this

 

=

if(count(if(ANMAAR='2013',JOURNALNR)) >= count(if(ANMAAR='2012',JOURNALNR)), rgb(255,0,0), rgb

(164,216,105))

View solution in original post

12 Replies
sushil353
Master II
Master II

try this:

expand the expression and click on background color.

then put your condition in the definition box

=if(count(ANMAAR)>2013,red())

HTH

Sushil

Not applicable
Author

Hi,

try with this expression as a value of Background color of the chart:

if(num#(ANMAAR)>2013, rgb(255,0,0))

regards

Not applicable
Author

hi,

    Try this

ifcount(ANMAAR)>=2013,JOURNALNR)

//Yusuf

Not applicable
Author

MAybe a little more explanation is needed

the bar is green and if the count of 2013 is greater than the count 2012 it should be red - that is what I´d like it to do

er_mohit
Master II
Master II

in expression tab you see the  '+'  icon  on expression click on it

and go to backgroung colour there you put condition

f(ANMAAR>2013,lightred())

raghavsurya
Partner - Specialist
Partner - Specialist

Hi,

You can give the condition in "BackGround Color" option of expression using RGB functionality to display the colour you want based on the selection.

Regards,

Raghav

kogasawara
Partner - Creator
Partner - Creator

try this

count({<ANMAAR={"2013"},ANMAAR={">2012">}JOURNALNR)

Not applicable
Author

Hi Polschou,

To change the bar chart colouring,  may be you can try to follow the below steps,

right click on bar chart --> select properties--->go to expression tab--> add the definition for the chart such as in your case it should be something like if(count>2013,yellow()). try and see if it works.

Anonymous
Not applicable
Author

hi

In the expression tab of the chart property, expand the plus sign along with the expression and add expression for background colour as follows

          =If(ANMAAR>'2013', RGB(255,0,0))

Regards

Revathy