Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
marishnagendran
Creator
Creator

Calculate Average in Column level

Dear All,

 

Last 5 daysQty
  
01/03/202020
02/03/202040
03/03/202020
04/03/202010
05/03/202025
06/03/202010

 

I want to color the column 1(Qty) based on average of last 5 days.

I.e

Avg is 21

will compare with each column and change the background of color.

 

Labels (4)
1 Solution

Accepted Solutions
NitinK7
Specialist
Specialist

Hi,

it is working for me

see below screenshot

final.PNG

Background color expression

=if(Sum(Qty)>Avg(total Qty),Green(),White())

                or

=if(Aggr(Sum(Qty),days)>Avg(total Qty),Green(),White())

View solution in original post

11 Replies
NitinK7
Specialist
Specialist

Hi

try the following steps

1 .write your expression 

2. expand expression (click + sign)

3. select background color option

and write below expression

if(qty>=ceil(Avg( TOTAL Qty)),Green(),White())

find below screnshot.

back color.JPG

marishnagendran
Creator
Creator
Author

Thanks for your response

I'm asking in Qliksense. The expression is not working

marishnagendran
Creator
Creator
Author

It is possible in Qliksense or not?????

NitinK7
Specialist
Specialist

Hi,

as of now it is not possible in qliksense .

but it might be possible using table chart extension 

 

Regards,

Nitin.

NitinK7
Specialist
Specialist

sorry my bad

it is possible in qliksense ( november 2019)

see below screenshot , write your expression in background color property

expression like

if ( qty >= ceil ( Avg ( TOTAL Qty) ), Green(), White() )

backcolor.PNG

regards,

Nitin.

marishnagendran
Creator
Creator
Author

We are using Qliksense November 2019 version.

But expression not working.

marishnagendran
Creator
Creator
Author

Kindly share that extension link.

NitinK7
Specialist
Specialist

Hi

it is not a extension,

it is a simple straight table chart

expand your expression (Measure)  then you will able to see this option

NitinK7
Specialist
Specialist

hI

see the below screenshots

qlik back color.PNGqlik back color1.PNGqlik ba.PNG

Expression -

if(Qty>=Avg(Total Qty),Green(),White())