Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Incremental load time format issue

Hi All,

Trying to implement incremental load for insert, update, delete

but time format is creating issue for me

Please see Script below and error screen shot

My SQL Server time stamp is in this format

Capture.JPG

The error i am getting is

Capture1.JPG

My script is as below

Max:

LOAD

Mod_Date

FROM

C:\Monica\Orders.qvd

(qvd);

Res:

Load Mod_Date as ModDate

Resident Max order by Mod_Date Desc;

Let MaxTimeStamp=Peek('ModDate',0);

Let MinDate=Peek('ModDate',-1);

Let MaxTIMESTAMP=Timestamp($(MaxTimeStamp),'YYYY-MM-DD hh.mm.ss');

drop table Max,Res;

Orders_INC:

SQL SELECT

  "Order_ID",

    "Create_By",

    "Create_Date",

    "Cust_Num",

    "Bill_ID",

     "Mod_By",

    "Mod_Date"

  FROM "Comp".dbo."Orders"

where CONVERT(VARCHAR(50), Mod_Date, 120)>='$(MaxTIMESTAMP)';

Concatenate

LOAD

"Order_ID",

    "Create_By",

    "Create_Date",

    "Cust_Num",

    "Bill_ID",

     "Mod_By",

    "Mod_Date"

FROM

C:\Monica\Orders.qvd

(qvd)

where not Exists (Order_ID);

Inner Join

SQL SELECT "Order_ID"

FROM "Comp".dbo."Orders";

Store  Orders_INC into ;

3 Replies
Anonymous
Not applicable
Author

Try changing:

Let MaxTIMESTAMP=Timestamp($(MaxTimeStamp),'YYYY-MM-DD hh.mm.ss');

To:

Let MaxTIMESTAMP=Timestamp('$(MaxTimeStamp)','YYYY-MM-DD hh.mm.ss');

SunilChauhan
Champion II
Champion II

You can try jonanse suggestion

but

Let MaxTimeStamp=Peek('ModDate',0); -> fetch first Record

Let MinDate=Peek('ModDate',-1);- fetch last Record

i thing this might me opposite as below

Let MaxTimeStamp=Peek('ModDate',-1);

Let MinDate=Peek('ModDate',0);

hope this helps

Sunil Chauhan
Not applicable
Author

Posted by me yesterday:

community.qlik.com/message/272826#272826