Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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)' ) ;
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)' ) ;
I tested with below sample data in Test.csv file
ID, Tagged,Reg_Date
1, Yes,3/1/2021
2, No, 1/20/2021
0, No, 2/28/2021
3, Yes,1/10/2021
Hi @qlikwiz123
Try like below
Load * from ursource where ID>0 and Not (Tagged='No' and floor(Reg_Date)<= floor(Today()));