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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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' ;