Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

baarathi
Contributor II

<= >= for date stored in variable

First NameLast NameDate of JoiningDesignationLocationSalary
GajaRamalingam1/1/2007Project ManagerChennai10000
JaganMohan1/1/2008Senior DeveloperChennai7000
VishalShete1/1/2012Project ManagerNew York10000
LaxmanReddy2/2/2012Senior DeveloperNew York20000
KarunNair3/3/2012Senior DeveloperChennai30000

Let varLastReloadDate = '1/1/2018';

Let varSal = 7000;

Let varThisReloadDate = '2/2/2018';


LOAD

    "First Name",

    "Last Name",

    "Date of Joining",

    Designation,

    Location,

    Salary

FROM [lib://Temp/Employee.xls]

(biff, embedded labels, table is Sheet1$)

Where "Date of Joining" > $(varLastReloadDate);

Let varLastReloadDate = varThisReloadDate;

As per the logic the above line should not load any line. But the entire 5 rows are loaded in script. In qliksense, does > and < work opposite for date?

3 Replies
Digvijay_Singh
Honored Contributor III

Re: <= >= for date stored in variable

Looks like $(varLastReloadDate) is numerically calculated, try putting apostrophe around.

Re: <= >= for date stored in variable

Use single quotes around your variable and see if that works

Let varLastReloadDate = '1/1/2018';

Let varSal = 7000;

Let varThisReloadDate = '2/2/2018';

LOAD

    "First Name",

    "Last Name",

    "Date of Joining",

    Designation,

    Location,

    Salary

FROM [lib://Temp/Employee.xls]

(biff, embedded labels, table is Sheet1$)

Where "Date of Joining" > '$(varLastReloadDate)';

zebhashmi
Valued Contributor

Re: <= >= for date stored in variable

Let varLastReloadDate = 1/1/2018;

or

Let varLastReloadDate =Date(1/1/2018, D/M/YY);

Community Browser