3 Replies Latest reply: Sep 5, 2016 5:57 AM by Ainhoa Sayans Alberti

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

• ###### 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())

• ###### 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

• ###### Re: Qlik Sense custom bar chart color by measure value

My bad, checking with wrong value