Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlik Sense Expert
I doing incremental load with qvd file with the sql database. I followed some below step
First: Create max date and pass it into variable
Second: using where condition greater than the variable. But it not working, by the way my date file is timestamp
This is my script to deploy incremental load
Fact:
date(Max(Timestamp(orderdate),'DD-MM-YYYY'))) as Maxdate
From [lib://DATA_ETL_LAYER/1. DATA/Sales.qvd];
let Vmaxdate = peek('Maxdate',0,Fact);
LIB CONNECT TO 'Microsoft_SQL_Server_BISVR';
Sql Select *
From Bi.Dbo."Sales" where to_date(to_char(orderdate),'DD-MM-YYYY'),'DD-MM'-YYYY') > todate('$(Vmaxdate)','DD-MM-YYYY')
concatenate
Load *
From [lib://DATA_ETL_LAYER/1. DATA/Sales.qvd];
But when i load the data, it seems qlik sense does not recognize the to char function. Could you guys help me with that ?
The problem is to_date in your variable. Anyway force Dates to Number to do simple:
Fact:
Num(Date#(Max(orderdate),'DD-MM-YYYY')) as Maxdate
From [lib://DATA_ETL_LAYER/1. DATA/Sales.qvd];
let Vmaxdate = peek('Maxdate',0,Fact);
Change:
From Bi.Dbo."Sales" where to_date(to_char(orderdate),'DD-MM-YYYY'),'DD-MM'-YYYY') > todate('$(Vmaxdate)','DD-MM-YYYY')
To:
From Bi.Dbo."Sales" where to_number(to_char(orderdate),'DD-MM-YYYY')) > $(Vmaxdate)
Your solution still have the same error like i do above. So does anyone help me with that, i using cast function in sql to convert timestamp to numeric but the result is wrong ( always missing one day ).