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

Understand If Condition

Hi All,

 

I need to understand the difference between 1st & 2nd expression in the image below.

I don't understand how 1st expression is working. Generally, we write some condition inside If condition and there is True and false values based on it but in 1st expression there are multiple if conditions without any true values.

Here is the dataset:

LOAD * INLINE [
Name, Article, Category, Value
ABC, Soap, Cat-A, 300
ABC, Phone, Cat-B, 1000
ABC, Car, Cat-C, 4000
ABC, ElectrCnics, Cat-C, 2000
ABC, Jewellery, Cat-C, 3000
XYZ, Electronics, Cat-C, 7000
XYZ, Car, Cat-C, 5000
XYZ, Phone, Cat-B, 2000
];

Community - If Condition.png

Regards,

Eric

Labels (5)
1 Reply
Or
MVP
MVP

There are, in fact - true conditions.

If the first condition is true, evaluate the second condition.

If the second condition is true, evaluate the third condition.

If that is true, CatA. Otherwise, CatB.

If either of the first conditions is false, null is returned (as there is no else section for either).