Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Positive and Negative Bars in Linear Gauge

I need to show positive values in Linear Gauge column as Green bars and negative values as Red (in opposite direction).

Trying to represent a column in straight chart as Linear Gauge.

The expression is : Sum(YTD.Sales) - Sum(PYTD.Sales)

Using one segment in Gauge Properties with Min as 0 and Max as:
Max(all Aggr(Sum(YTD.Sales) - Sum(PYTD.Sales), Dimension1, Dimension2, Dimension3, Dimension4))

Mode is "Fill to Value" and Style is "Line"

But only get Green bars and blank for negative values.

Any thoughts ?

4 Replies
JonnyPoole
Employee
Employee

do you want the negative values to show as negative numbers ( your min = 0) or as the absolute value of the negative number ?

danielblank
Partner - Contributor III
Partner - Contributor III

If I understand you correctly, you try to show the difference between Sales YTD actual year and the same period in the previous year. If you calculate Sum(YTD.Sales) - Sum(PYTD.Sales) you will get an absolute value, not a percentage. This way you will need a range between  Sum(PYTD.Sales) * (-1) and Sum(YTD.Sales) for your gauge.

However, if you want to show the difference in red (negative values) and green (zero oder positive values), you will need two segments. The first segment (red) should start at sum(PYTD.Sales) * (-1) and the second segment (green) should start at value 0.

Maybe you have a sample file of the gauge you tried?

Hope that helps. 🙂

Kind regards,

Daniel

Anonymous
Not applicable
Author

Jonathan - I want negative numbers to show as negative and not as absolute.

JonnyPoole
Employee
Employee

Hi sorry for the delay - if you are still working on this can u post your QVW sample to review  ?