Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Using If while loading

Dear All,

I want to use if clause while loading data/files in script.

My files are having date and want to stop the script to run/reload once date will reach specific date.

i.e. if DATE > 10/01/2013, the script will show me error and nothing will be loaded....

is it possible?

1 Solution

Accepted Solutions
jagannalla
Not applicable

Re: Using If while loading

what is the format of date column ?

Either timestamp or date ?

If possible try this

Where Date(DATE,'DD/MM/YYYY')) <= Date('10/01/2013','DD/MM/YYYY');

(or)

Where Date(DATE,'DD/MM/YYYY hh:mm:ss')) <= Date('10/01/2013','DD/MM/YYYY hh:mm:ss');

Cheers!!

Jagan

5 Replies
Gysbert_Wassenaar
Not applicable

Re: Using If while loading

Try adding a where clause:

Table1:

LOAD *

[myexcelfile.xls] (biff, embedded labels, table is Sheet1$)

Where Date#(DATE,'DD/MM/YYYY')) <= Date#('10/01/2013','DD/MM/YYYY');

With DATE being the field you want to filter on. This will not throw an error, but just not load anything with a date over 10/01/2013.


talk is cheap, supply exceeds demand
Not applicable

Re: Using If while loading

Thanks for your reply.

Tried above but it's not loading data at all... even if my date is less than date 10/01/2013

Not applicable

Re: Using If while loading

Thanks for your reply.

Tried above but it's not loading data at all... even if my date is less than date 10/01/2013

jagannalla
Not applicable

Re: Using If while loading

what is the format of date column ?

Either timestamp or date ?

If possible try this

Where Date(DATE,'DD/MM/YYYY')) <= Date('10/01/2013','DD/MM/YYYY');

(or)

Where Date(DATE,'DD/MM/YYYY hh:mm:ss')) <= Date('10/01/2013','DD/MM/YYYY hh:mm:ss');

Cheers!!

Jagan

Not applicable

Re: Using If while loading

Excellent.... working fine.