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

Understanding Script

Hi,

I have a code in my script like this that somebody has written previously:

If(Sales> '0' or [Sales Flag] = 'Y', 'Y', 'N') as WarrantFlag

What is this code mean?

Is it like this? if sales is greater than zero or Sales flag = Y then Y otherwise N.

If i want to us these piece of code in where clause after the load statement then how should i write the code?

Thanks,

ahmed100

12 Replies
avinashelite

LOAD *

;

from

table

where

Sales> '0' or [Sales Flag] = 'Y';



this should work

MayilVahanan

Hi

Your understanding is correct

     if sales is greater than zero or Sales flag = Y then Y otherwise N.


Try like this

Load * where WarrantFlag = 'Y'; // Preceding Load

Load *, If(Sales> '0' or [Sales Flag] = 'Y', 'Y', 'N') as WarrantFlag

Your TableName;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
ashwanin
Specialist
Specialist

You can use like this.


Load

------,

----,

---

from xyx Where Sales > '0' or [Sales Flag] = 'Y' ;