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: 
qlikwiz123
Creator III
Creator III

Load Table based on Conditions

I need to load data from a table based on multiple conditions.

Load Data only if the ID>0 and Not (Tagged=No and Reg_Date<=Today)

How do I combine Where and Where Not in the same Load Script table condition? Also, Not (Tagged=No and Reg_Date<=Today) means, DO NOT Load if both conditions are met, not either or. How do I combine these two conditions and load data?

Labels (1)
1 Solution

Accepted Solutions
skamath1
Creator III
Creator III

Below is the script 

 

Let vToday = Date(Today(),'M/D/YYYY') ;

LOAD ID,
Tagged,
Reg_Date
FROM
[Test.csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq)
where ID > 0 and Not (Tagged = 'No' and Date(Reg_Date,'M/D/YYYY') <= '$(vToday)' ) ;

 

View solution in original post

3 Replies
skamath1
Creator III
Creator III

Below is the script 

 

Let vToday = Date(Today(),'M/D/YYYY') ;

LOAD ID,
Tagged,
Reg_Date
FROM
[Test.csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq)
where ID > 0 and Not (Tagged = 'No' and Date(Reg_Date,'M/D/YYYY') <= '$(vToday)' ) ;

 

skamath1
Creator III
Creator III

I tested with below sample data in Test.csv file

skamath1_0-1612318032178.png

ID, Tagged,Reg_Date
1, Yes,3/1/2021
2, No, 1/20/2021
0, No, 2/28/2021
3, Yes,1/10/2021

MayilVahanan

Hi @qlikwiz123 

Try like below

Load * from ursource where  ID>0 and Not (Tagged='No' and floor(Reg_Date)<= floor(Today()));

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