Skip to main content
Announcements
Jan 15, Trends 2025! Get expert guidance to thrive post-AI with After AI: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ToinkToinkTigger
Contributor
Contributor

Dual if function in Qliksense

Hello there,

I have been playing around with if functions to change the background color of fields in my dashboard. Strangely enough this is working for 3 if statements:

if(Scope='GREEN',RGB(152,251,152),if(Scope='ORANGE',RGB(255,215,0),if(Scope='RED',RGB(240,128,128))))

However,

I cant seem to get this right for 2 if statements.

Can someone show me how to set this up for 2 if conditions within one sentence?

Thanks in advance,

Labels (1)
5 Replies
Or
MVP
MVP

if(Scope='GREEN',RGB(152,251,152),if(Scope='ORANGE',RGB(255,215,0)))

Though in this sort of scenario, you might want to consider using Match() instead of several if() statements.

ToinkToinkTigger
Contributor
Contributor
Author

Hey thanks,

Why should one use Match() instead of several if() statements?

How would that look in this case?

Or
MVP
MVP

Pick(Match(Scope,'GREEN','ORANGE'),RGB(152,251,152),RGB(255,215,0)) for example.

You can match as many values as you want and it comes out a lot cleaner than writing a bunch of nested if() statements, at least in my opinion (though nested if() statements will also work).

ToinkToinkTigger
Contributor
Contributor
Author

Cheers! Thanks for your help

rudesingh56
Contributor
Contributor

Thanks for your help  get-vidmateapp.com

mobdro download