Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
my tablebox looks like the following:
Product | Discount |
---|---|
A | 0.3 |
B | 0.19 |
A | 0.34 |
A | 0.2 |
B | 0.11 |
B | 0.14 |
and so on..
Now I would like to color the highest 30% discount values in red. But not the highest 30% of all products combined, but for every product individually. So in this example the 2nd and 3rd row (highest % of A and B) should be red, and not 1st / 3rd.
Hope my concern is clear.
Thank you in advance. Best regards!
Hi Ludwig,
Please find attached. I used a straight table with dimensions Product and Discount. Under the Background Color and Text Color for the dimension Discount, I used the following expressions:
For the max Discount only:
Background Color:
=if(Discount=max(total <Product> Discount), red())
Text Color:
=if(Discount=max(total <Product> Discount), white())
For the top 30% when the table is sorted by Product, then Discount:
Background Color:
=if(rank(sum(Discount))<=max(total aggr(rank(sum(Discount)), Product, Discount))*.3, red())
Text Color:
=if(rank(sum(Discount))<=max(total aggr(rank(sum(Discount)), Product, Discount))*.3, white())
For the top 30% when the table is sorted by just Discount Descending:
Background Color:
=if(aggr(rank(sum(Discount)), Product, Discount)<=max(total aggr(rank(sum(Discount)), Product, Discount))*.3, red())
Text Color:
=if(aggr(rank(sum(Discount)), Product, Discount)<=max(total aggr(rank(sum(Discount)), Product, Discount))*.3, white())
I added some values to the data in order for the top 30% to actually show colors.
Hope this helps!
Hi Ludwig -
Is this for Qlik Sense or QlikView? - Just want to make sure as the process is similiar, but how you apply it is different.
please let us know.
Mike
I'm sorry I mixed that up. This is for QlikView!
Ludwig
Hi Ludwig - OK - I will move this to the appropriate forum.
In the mean time - check out this video that may help you with conditional styling in QlikView.
Qlikview Pivot with Conditional Formatting by RFB 16 - YouTube
Please mark the appropriate replies as helpful / correct so our team and other members know that your question(s) has been answered to your satisfaction.
Regards,
Mike
Thanks .. Much helped!
Thank you for the link, but unfortunately it does not solve my problem.
As I mentioned, I do not want to color the overall lowest values, but the lowest values for each product individually.
Is it clear what I mean? Thank you for your help !
Anyone to help me?
Thank you!
Hi Ludwig,
Please find attached. I used a straight table with dimensions Product and Discount. Under the Background Color and Text Color for the dimension Discount, I used the following expressions:
For the max Discount only:
Background Color:
=if(Discount=max(total <Product> Discount), red())
Text Color:
=if(Discount=max(total <Product> Discount), white())
For the top 30% when the table is sorted by Product, then Discount:
Background Color:
=if(rank(sum(Discount))<=max(total aggr(rank(sum(Discount)), Product, Discount))*.3, red())
Text Color:
=if(rank(sum(Discount))<=max(total aggr(rank(sum(Discount)), Product, Discount))*.3, white())
For the top 30% when the table is sorted by just Discount Descending:
Background Color:
=if(aggr(rank(sum(Discount)), Product, Discount)<=max(total aggr(rank(sum(Discount)), Product, Discount))*.3, red())
Text Color:
=if(aggr(rank(sum(Discount)), Product, Discount)<=max(total aggr(rank(sum(Discount)), Product, Discount))*.3, white())
I added some values to the data in order for the top 30% to actually show colors.
Hope this helps!
This post really helped. Thanks !