Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
MuraliPrasath
Creator III
Creator III

Different Background color based on 80% sales out of total sales in Table box. How to do this?

I have a table that needs a background color of 80 percentage sales are in Yellow color and rest are in blue color.

how to achieve this in Qlik Sense. 

Capture.PNG

 
 

 

 

Labels (1)
5 Replies
mfarsln
Creator II
Creator II

Hi,

Try below code;

 

if(
RangeSum(above(TOTAL (sum(Sales)/sum(total Sales)), 1, RowNo(TOTAL)))<=0.8,yellow(),blue()
)

 

You should add this to every column's background color expression tab.

 

MuraliPrasath
Creator III
Creator III
Author

Hi,

This is not working, if I apply this to my Table box then my sorting is not working. 

If we use Above function then sorting will not work. Any other fix for this? thanks for your try so far. 🙂

mfarsln
Creator II
Creator II

Hi,

What is your sorting expression?

MuraliPrasath
Creator III
Creator III
Author

Hi,

My sorting orders are 

1. Total Sales%

2. Sales

 

mfarsln
Creator II
Creator II

Hi,

Can you try below expression?

Aggr(
    If(Rangesum(Above(Sum(Sales)/Sum(total Sales),1,RowNo()))<=0.8, yellow(),
           blue()),
    (ID,(=Sum(Sales)/sum(total Sales),Desc))
)