Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to display highest value on one color and lowest value on one color in bar chart ?

how to display highest value on one color and lowest value on one color in bar chart  ?

6 Replies
its_anandrjs
Champion III
Champion III

Hi,

In the Bar chart expression click on the plus sign and in Background Color write expression

BaColor.png

=if(sum(Metrics) = Min(total Metrics), Red(),

  if(sum(Metrics) = Max(total Metrics), Green()))

Or

LOAD * Inline  [

ID,Value

A,20

B,30

C,10

D,45

E,50  ];

Ex:-

if(sum(Value) = Min(total Value), Red(),

if(sum(Value) = Max(total Value), Green()))

Regards

Anand

MK_QSL
MVP
MVP

@ Anand.... I think your one will not work.....I haven't tested but may be I could be wrong !!

Consider below script...

Sales:

Load * Inline

[

  Customer, Sales

  A, 100

  B, 75

  C, 50

  D, 120

  E, 150

  F, 50

  G, 200

  I, 225

  J, 175

];

Create a Bar Chart

Dimension

Customer

Expression

SUM(Sales)

Now to differentiate SUM(Sales) based on Min and Max Sales, click on + sign of Expression Tab and write below expression in Background Color

=IF(SUM(Sales) = Min(TOTAL Aggr(Sum(Sales),Customer)),Red(),

  IF(SUM(Sales) = Max(TOTAL Aggr(SUM(Sales),Customer)), Green(),QlikTechGray()))

Hope this will help !

Happy Qliking...

ecolomer
Master II
Master II

Is this you need?

p07.png

ecolomer
Master II
Master II

p06.png

MarcoWedel

Hi,

one solution could be:

Barchart Colors based on Values

QlikCommunity_Thread_143369_Pic1.JPG.jpg

QlikCommunity_Thread_143369_Pic2.JPG.jpg

When using the Min/Max approach, you have to compare against the TOTAL min or max.

hope this helps

regards

Marco

its_anandrjs
Champion III
Champion III

@Manish,

No both are working with the expression in the Background Color


=if(sum(Sales) = Min( Total Sales), Red(),
 
if(sum(Sales) = Max( Total Sales), Green()))

With your given data and it gives

MaxnMIn.png

But i believe for this type of data use Rank to represent data but it display correctly.

Regards
Anand