Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

mitchjb2008
New Contributor III

Using variable in Where statement in load script...

The following error occurred:

Unknown Error

The error occurred here:

LOAD

    [Interview Finish Date]

FROM [lib://Apps/All Surveys for 16MY CQI Qlik Sense.xlsx]

Where [Interview Finish Date]<=42501

(ooxml, embedded labels, table is GridExport)

Data has not been loaded. Please correct the error and try loading again.

I can't seem to get this to work:

Where [Interview Finish Date]<=$(MaxIFDate)

It gives me this in the error note:

Where [Interview Finish Date]<=42501


For whatever reason, the script is failing and I believe it to be related to the format of the [Interview Finish Date] column, as it is saved in a General format in the xlsx file. Can someone help me figure out the breakdown in syntax/format?

Thanks in advance!

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Using variable in Where statement in load script...

I think you where clause is not at the right spot, try this by putting it below the (ooxml ....) part:


LOAD [Interview Finish Date]

FROM

[lib://Apps/All Surveys for 16MY CQI Qlik Sense.xlsx]

(ooxml, embedded labels, table is GridExport)

Where [Interview Finish Date] <= $(MaxIFDate);

2 Replies
MVP
MVP

Re: Using variable in Where statement in load script...

I think you where clause is not at the right spot, try this by putting it below the (ooxml ....) part:


LOAD [Interview Finish Date]

FROM

[lib://Apps/All Surveys for 16MY CQI Qlik Sense.xlsx]

(ooxml, embedded labels, table is GridExport)

Where [Interview Finish Date] <= $(MaxIFDate);

mitchjb2008
New Contributor III

Re: Using variable in Where statement in load script...

I believe that fixed it! Thanks for helping!