Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

wrong date field

Hi guys,

I would like a implement an incremental load ; get the historical records plus result of today's query

below my script:

NoConcatenate

transaction:

load *

from 'transaction_Dist1507.qvd' (qvd);

//LAST modfied date

NoConcatenate

Last_Updated_Date:

load max(STARTOFCHARGINGDATE) as Maxdate

Resident transaction;

//store max date into a variable

let Last_Updated_Date = Peek('Maxdate');

//deletetransactiontable

drop table transaction;

//load incremantal data

OLEDB CONNECT TO [] (XPassword is );

NoConcatenate

transation_tmp:

load

*,

date#(Date( REPORT_DATE, 'DD/MM/YYYY')) as Date_Transaction

;

select

tt.*,

d.aliasname as alias_debit

from (

SELECT

trans.*,

tab.aliasname alias_credit

FROM   RECHARGE_PM.POS_REPORT trans , RECHARGE_PM.DUMP_RETAILER tab

WHERE  

trans.credit_ACTOR_ID=tab.ACTORE_ID(+)

and report_type = 'TSR001'

and debited_ACTOR_ID IN ($(vActore))

AND FUNCTION = 243 ) tt,RECHARGE_PM.DUMP_RETAILER d

where tt.debited_actor_id=d.actore_id(+)

and tt.STARTOFCHARGINGDATE > $(Last_Updated_Date) ;

NoConcatenate

transaction:

load *,

AutoNumber(date( Date_Transaction,'DD/MM/YYYY'),'%Date ID') as [%Date ID]

resident transation_tmp;

//concatenate with qvd

concatenate

load *

from 'transaction_Dist1507.qvd' (qvd);

//replace old qvd file

store transaction into 'transaction_Dist1507.qvd' (qvd);

drop table transation_tmp;

//script calendar (2015/2016)

The problem is that I didn't get the right Date ID that corresponds with the date field in my qvd (the dates of my transactions are not correct). see what I get:

Capture.PNG

What do you suggest to fix that?

Thanks in advance.

3 Replies
MK_QSL
MVP
MVP

Try

and tt.STARTOFCHARGINGDATE > '$(Last_Updated_Date)' ;

master_student
Creator III
Creator III
Author

ok, wil try and let you know. Thanks

master_student
Creator III
Creator III
Author

The pb seems fixed but I didn't know why I am still getting the wrong date ID for the date 18/07/2016. see bellow:

Capture.PNG