Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlik Sense custom bar chart color by measure value

Hello everyone,

I have been searching for this for a while and cant take it. I have a bar chart that shows tons soled for month.

As we need for other porpouses all years data, but for this chart only this year data we use this formula as measure

sum( {$<Date={">=$(=timestamp(yearStart(Today())))<=$(=timestamp(yearend(Today())))"} > } [Tons sold])

And the value of month as dimensión.

I want that the bars take red or green color if they are (the value of the bar) bigger of certain value.

I mean maybe Januari and Agust must be in red and the rest of the chart in green.

I thik I have to use color by expresión, but when I put the expresión

if(sum([Tons sold])>xValue,red(),green())

All the bars turn green couse is taking all the Tons sol in all time to compare.

Labels (1)
  • Chart

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Use the same expression in the if statement:

if(sum( {$<Date={">=$(=timestamp(yearStart(Today())))<=$(=timestamp(yearend(Today())))"} > } [Tons sold])>xValue,red(),green())


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

Use the same expression in the if statement:

if(sum( {$<Date={">=$(=timestamp(yearStart(Today())))<=$(=timestamp(yearend(Today())))"} > } [Tons sold])>xValue,red(),green())


talk is cheap, supply exceeds demand
Not applicable
Author

Tryed that too and I have the same problema, all the bars ahve the same value, red or green if the total amount of tons sold this year is bigger or smaller than xValue

Not applicable
Author

My bad, checking with wrong value