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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Simon_BI
Contributor II
Contributor II

Date comparison

Here i want to only load data with End_Date >= '7/1/2020'.

It works when i just script like Where END_DATE >= '7/1/2020' , but it fails when i use variable to replace '7/1/2020'.

Attached is my script, could someone help me to find out why the variable doesn't work? 

Thanks

 

let vr = addmonths(monthstart(date(Today(),'M/D/YYYY')),8);

T1:
LOAD * INLINE [
ITEM, COUNTRY, END_DATE
30234229, AU, 12/1/2020
30234229, SG, 2/1/2014
30234229, HK, 2/1/2014
30234229, TH, 2/1/2014
30234229, CN, 2/1/2022
30234229, TW, 2/1/2014
30234229, JP, 1/1/2100
30234229, ID, 2/1/2014
30234229, MY, 2/1/2014
30234229, KR, 12/1/2024
30234229, IN, 4/1/2018
];

NoConcatenate
T2:
LOAD *
Resident T1
//Where END_DATE >= '7/1/2020' ;
Where END_DATE >= $(vr);

DROP Table T1;

1 Solution

Accepted Solutions
Lisa_P
Employee
Employee

missing the 'quotes'

...  Where END_DATE >= '$(vr)';

View solution in original post

2 Replies
Lisa_P
Employee
Employee

missing the 'quotes'

...  Where END_DATE >= '$(vr)';

Simon_BI
Contributor II
Contributor II
Author

yes yes yes, you're right. Thank u so much