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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
everest226
Creator III
Creator III

if statement

1 i have a field in script called  donation which has flag value  true  OR false

2 i have another field "Method" which has value Land, Sky  and Sea,

requirement is if the donation is true than it it should be "Done " if it is false than "NODone"   and also this logic is only applicable on Land not in Sky and Sea

omarbensalem

jagan

Labels (1)
1 Solution

Accepted Solutions
OmarBenSalem
Partner - Champion II
Partner - Champion II

try shting like:

table:

Load *, if(upper(Method)='LAND' and upper(Flag)='TRUE','Done',

if(upper(Method)='LAND' and upper(Flag)='FALSE','NotDone',

Flag )) as YourNewFlag;

load Flag,

Method,

...

from source;

drop field Flag from table;

View solution in original post

4 Replies
vishsaggi
Champion III
Champion III

Can you share some sample data set and your expected output out of that data set.

May be this ? Correct me basically for Land method you want to assign Done and NotDone? Is this interpretation is right?

IF(Method = 'Land' AND Donation = 'True', 'Done',

IF(Method = 'Land' AND Donation = 'False', 'NotDone')) AS NewFlag

OmarBenSalem
Partner - Champion II
Partner - Champion II

try shting like:

table:

Load *, if(upper(Method)='LAND' and upper(Flag)='TRUE','Done',

if(upper(Method)='LAND' and upper(Flag)='FALSE','NotDone',

Flag )) as YourNewFlag;

load Flag,

Method,

...

from source;

drop field Flag from table;

CarlosAMonroy
Creator III
Creator III

Hi Ujjwal,

Try:

if(Method = 'Land' and Donation = 'True', 'Done',

if(Method = 'Land' and Donation = 'False', 'No Done','NA')) as NewField

Thanks,

Carlos

everest226
Creator III
Creator III
Author

omarbensalem‌    thanks  Omar