Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Join “Do More With Qlik” with Mike Tarallo to get a first-hand look at the New Authoring Experience, June 29th: REGISTER HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
erhancopur
Contributor II
Contributor II

load script date format error

Hello

I am trying to load below "load script"

2.PNG

but i get the following error

1.PNG

the date format at sql is '2018-01-01 00:00:00:000'.

can someone help with this error. What should i do?

My aim is to load only the updated rows from the sql server to qvd file.

20 Replies
erhancopur
Contributor II
Contributor II
Author

This is the error

where DateTime > Date( >>>>>>43353<<<<<<,598842593, '')

erhancopur
Contributor II
Contributor II
Author

currently as below.

SET TimestampFormat='D.MM.YYYY hh:mm:ss[.fff]';

I tried changing it qith same sql format but no luck.

Maybe we need to try changing the Last_Update_Time variable format, since the error is at that line.

avinashelite

Try like this

Where DateTime > Timestamp($(Last_Update_time),'YYYY-MM-DD hh:mm:ss[.fff]')

erhancopur
Contributor II
Contributor II
Author

I also found this error in data manager, maybe its the reason.

5.PNG

avinashelite

Your date format issue is resolve ...for the above criteria we don't have the data I guess 

gajapathy74
Creator II
Creator II

From your original post and the recent one, it looks like your lib (connection) folder (or) path is missing. Please check the connection is created and pointed to the correct path to the hourly.qvd file.

Also the table name is referred as "Incremental", make sure you have not changed the table name into something else.

erhancopur
Contributor II
Contributor II
Author

thanks, i deleted and re created the connection, and made sure the table name is correct.

nsetty
Partner
Partner

Try

Where DateTime > DATE#($(Last_Update_time), 'YYYY-MM-DD')

gajapathy74
Creator II
Creator II

Is this works now?

erhancopur
Contributor II
Contributor II
Author

Below is the load script i run:


LIB CONNECT TO 'MaintenanceSQL';

URTBASE:

SQL SELECT ID,

    ----,

    DateTime,

    Referans

FROM ----."URT_BASE" where DateTime > '2018-09-01 00:00:00:000' ;


Last_Update_time:

load max(DateTime) as MaxDateTime

resident URTBASE;

Let Last_Update_time = Date(Peek('MaxDateTime',0,'Last_Update_time'), 'DD:MM:YYYY');

Drop Table URTBASE;


// Load Incremental data

Incremental:

LOAD ID,

    CELLNO,

    DateTime,

    Referans

FROM -----."URT_BASE"

where DateTime > $(Last_Update_time);


Concatenate

Load ID,

     -----,

     DateTime,

     Referans

From 'lib://Qlik_QVD_DATA/Hourly.qvd' (qvd);

Store Incremental into 'lib://Qlik_QVD_DATA/Hourly.qvd' (qvd);


Drop Table Incremental;



Now the error is


The following error occurred:

This statement only works with lib:// paths in this script mode

The error occurred here:

Incremental: LOAD ID, -, DateTime, Referans FROM ---.dbo."URT_BASE" where DateTime > 11:09:2018

when i  change database connection from sql to Lib Folder connection this error occurs.

The following error occurred:

Unexpected token: ':', expected one of: 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', 'OPERATOR_STRING_CONCAT', 'like', 'and', ...

The error occurred here:

Incremental: LOAD ID, ---, DateTime, Referans FROM 'lib://Qlik_QVD_DATA/Hourly.qvd' (qvd) where DateTime > 11>>>>>>:<<<<<<09:2018