Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Highlighted
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.

Tags (3)
1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Qlik Sense custom bar chart color by measure value

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
3 Replies
MVP & Luminary
MVP & Luminary

Re: Qlik Sense custom bar chart color by measure value

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

Re: Qlik Sense custom bar chart color by measure value

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

Re: Qlik Sense custom bar chart color by measure value

My bad, checking with wrong value