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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help in Formula - Gauge Light

Hi friends,

For display of traffic gauge lights, i am using the formula where

0 - Green

1-Amber

2-Red

=If((Column(3)/Column(2))*100 < '0%','0',If((column(3)/column(2))*100 > '0%' and (column(3)/column(2)) < '5%','1','2'))

But when the condition is 0%, it should show green but it is showing red.

Can someone help me with formula?

Regards,

KC

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

=If(Column(3) / Column(2) < 0 Or Column(2) = 0, 0,

  If(Column(3) / Column(2) < 0.05, 1, 2))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

11 Replies
awhitfield
Partner - Champion
Partner - Champion

Can you upload your qvw?

Andy

Not applicable
Author

Hey Andy, Sorry but i can't

Will post something very similar that will help you to understand.

Regards,

KC

robert_mika
Master III
Master III

Try to take of all '

=If((Column(3)/Column(2))*100 < 0,0,If((column(3)/column(2))*100 => 0 and (column(3)/column(2)) < 5,1,2))


Feeling Qlikngry?

How To /Missing Manual(18 articles)

jonathandienst
Partner - Champion III
Partner - Champion III

This will fix your expression:

=If((Column(3) / Column(2)) * 100 < 0, 0,

  If((Column(3) / Column(2)) < 0.05, 1, 2))

But how are you getting from there to the colours RAG?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

why are you using % .. by default QV returns in numbers have you specified anywhere to return in percent ?

use


=If((Column(3)/Column(2))*100 < 0,0,If((column(3)/column(2))*100 > 0 and (column(3)/column(2)) < 5,1,2))

Thanks

BKC

sunny_talwar

all other colors are working fine for you?

Not applicable
Author

Hi,

All Rag's colors are working fine except for one. Posting an excel sheet with details.

Hope that will help.

Regards,

KC

Anonymous
Not applicable
Author

Try this please:


=If((Column(3)/Column(2))*100 <= '0','0',If((column(3)/column(2))*100 > '0' and (column(3)/column(2)) < '5','1','2'))

Not applicable
Author

If i simply use =(Column(3)/Column(2)) for calculation of Column 4, i am getting dash

So if column 3 = 0 and column 2 = 0

then column 4 will be 0% or - should return green color not red.

Am i making sense? Anything more than 5% should be red.

Regards,

KC