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

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

Color Coding Text Boxes

I have 5 text boxes containing the revenue figures for each location and a text box containing the total revenue

I want to shade background of each of the 5 text boxes depending on their % of the total.

I can get the formulae to shade red and green depending on if the values are over or under 30% this formuale I have applied to the background formulae of Market St, Shudehill & Victoria. Market st and Victoria use the same basic two colour shading for +/-50% and works

BUT i want to shade the boxes in a gardient

I have tried to apply a formulae to the Shudehill background which looksup the percentage and takes the clour from a table but this doesnt work

In my final model i would like to use the gradual shading and have a different shade for each of the values !% to 100%

Any ideas please?

6 Replies
MK_QSL
MVP
MVP

Like This?

Not applicable
Author

I have a licenced edition at work but I cant open your file at home.. could you key in the formulae

MK_QSL
MVP
MVP

You can use calculated Base Color... like below..

ColorMix1(

(Sum({$<Stop={'MKT'}>}Revenue)/Sum(Revenue))/

Max(Total Aggr(Sum({$<Stop={'MKT'}>}Revenue)/Sum(Revenue), Stop)),

White(),

Green()

)

===============

Now Chagne MKT according to your field cell name... i.e. SHU, VIC,SPS, PIC etc...

I have taken WHITE() and GREEN() color for color gradient but obviously you can change as per your choice...

Not applicable
Author

Thats really helpful, nearly there i think. My fault this but in practice I didnt want the total value to be included. I wanted the darkest colour to be the highest value in the range of stops. So that the stop with the most revenue turned bright red. Could this be done?

rustyfishbones
Master II
Master II

Hi Glenn,

Is this what you require, it works, but I don't have time to explain it

Regards

Alan

rustyfishbones
Master II
Master II

Hi Glenn,

I will explain, did not realize you can't open the file

Step 1

Create a Variable called vColorIndex like below

2014-03-21_1112.png

Step 2 your text box Expression

2014-03-21_1112_001.png

Step 3 Your Background Color

2014-03-21_1112_002.png

Just change the Set Analysis for Stop for each Text Object

Hope that helps

Regards

Alan