Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use the if statement

How to use the "If" statement with 3 possibilities in one expression?

Result expression 1 is a value (f.e. "2.7")

I've made 3 categories

"Good" if value < 2

"Normal" if value >=2 and ❤️

"Bad" if value >=3

How to make a new expression which shows me the value

"Normal" when exprssion 1 = 2.7

or which shows me

"Good" if expression 1 = 1.7

or shows me

"Bad" if expression 1 = 3.7

1 Solution

Accepted Solutions
giakoum
Partner - Master II
Partner - Master II

if(exprssion 1 = 2.7, 'Normal', if(expression 1 = 1.7, "Good", if(expression 1 = 3.7, "Bad", "NA")))

View solution in original post

4 Replies
giakoum
Partner - Master II
Partner - Master II

if(exprssion 1 = 2.7, 'Normal', if(expression 1 = 1.7, "Good", if(expression 1 = 3.7, "Bad", "NA")))

alexandros17
Partner - Champion III
Partner - Champion III

Here it is

If(value < 2, 'Good',

     if(value >=2 and value <3, 'Normal' ,' Bad')

)

Hope it helps

its_anandrjs

Write like below

If(exprssion_1 = 2.7, 'Normal',

If(exprssion_1 = 1.7, 'Good',

If(exprssion_1 = 3.7,'Bad'))) as Result_expression

Hope this helps

Thanks & Regards

PrashantSangle

Hi,

Try this,

If(exprssion_1< 2, 'Good', if( exprssion_1<3, 'Normal' ,' Bad')) as Result

Regards,

PS

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂