Qlik Community

Qlik Sense App Development

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

Not applicable

Help with color in line graph/chart

Hi, I just started to use Qlik Sense and I want to personalize the colors in a line graph/chart, according to the value of the expression.

I want to change the color of the line depending on the value. If the value is lower than zero, I need one color, and if the value is higher than zero, I need another color. I only get the result of the picture, but it is not exactly what I want.

I have tried two different methods.

  • Color by measure

  • Color by expression. I used this expression: =IF(ExistenciaProducto < 0, RGB(255, 0, 0), RGB(40, 180, 220))

The table where I get the data has this structure:

Row NumberDate (MM/DD/YYYY)Movement unitsOn Inventory
101/01/20175050
201/10/2017-2525
301/10/2017-205
402/04/2017150155
502/05/2017-10055

The dates are not always the same, I have one row for each movement, and I can have more than one movement per day.

Thanks!

6 Replies
shraddha_g
Honored Contributor III

Re: Help with color in line graph/chart

In your expression --> IF(ExistenciaProducto < 0, RGB(255, 0, 0), RGB(40, 180, 220))

instead of ExistenciaProducto, put a expression you have used in Measure section of chart

Not applicable

Re: Help with color in line graph/chart

Hellor, the measure I'm using is the same, ExistenciaProducto.

Is this what you are referring to?

shraddha_g
Honored Contributor III

Re: Help with color in line graph/chart

Don't you think it should be an aggregation expression?

For Ex. Sum(FieldName)

Not applicable

Re: Help with color in line graph/chart

I changed it, "RangeSum(Above(Sum(Units), 0, RowNo()))" instead "Sum(Inventory)"

It works at the same way, even with this aggregation expression as the measure for the chart and for the colour condition.

shraddha_g
Honored Contributor III

Re: Help with color in line graph/chart

can you share sample app?

Not applicable

Re: Help with color in line graph/chart

This is the basic structure