Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
The error i am getting is
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
Try changing:
Let MaxTIMESTAMP=Timestamp($(MaxTimeStamp),'YYYY-MM-DD hh.mm.ss');
To:
Let MaxTIMESTAMP=Timestamp('$(MaxTimeStamp)','YYYY-MM-DD hh.mm.ss');
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
Posted by me yesterday:
community.qlik.com/message/272826#272826