Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

To display either Red or Green icon in Straight Table for Variance

Dear QV Experts,

Please find enclosed the TestSample.qvw.

'Var' column to be displayed either in Red or Green, if it is greater than 10000 then Green & less than 10000, should be Red.

I selected Traffic Light Gauge with Two Segments. Are there any alternate ways?

Please suggest me.

TestSample.jpg

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi,

Check the attachment.

Capture.PNG

View solution in original post

8 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

What you have done is right.

You can also use the If statement to do this, but with huge data that may give performance issue.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
paul_vans267
Partner - Contributor II
Partner - Contributor II

Hi Sasi,

Another option is to use characters and text colours to reflect this.  I have attached a qvw with an extra column attached to reflect this.

The expression used is:

=if(Sum(Sales)-Sum(Spend)>10000,chr(9650), chr(9660))

if greater than 10000 uses chr(9650) which is an up arrow and if it is less than 10000 uses chr(9660) which is a down arrow. 

Then clicked on the plus sign next to the expression name.  Select the text color options and use the same if statement, however this time with RGB values for true and false:

=if(Sum(Sales)-Sum(Spend)>10000,green(), red())

Of course, if you want to use different symbols, read this:
How to find a number for a char: chr() and ord() functions

which is very helpful.

Hope this helps.

Paul

Colin-Albert

You can use Ascii characters 9650 & 9660

   if( Variance > 10000, chr(9650), chr(9660))

You will also need to set the text colour of the expression

    if( Variance > 10000,  rgb(0,128,0), rgb(255,0,0))

variance.JPG

sathishkumar_go
Partner - Specialist
Partner - Specialist

Try if condition.

if([Sales] - [Spend] > 10000,rgb(0,127,0),rgb(255,0,0))

-Sathish

sathishkumar_go
Partner - Specialist
Partner - Specialist

sathishkumar_go
Partner - Specialist
Partner - Specialist

-Sathish

tamilarasu
Champion
Champion

Hi,

Check the attachment.

Capture.PNG

Not applicable
Author

Thanks a lot for all for your valued solutions.