Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Gaurav_Kapoor
Contributor
Contributor

Incremental Load

Can you tell me that this  given incremental load will give me a duplicacy ? 

 

LIB CONNECT TO 'Microsoft_SQL_Server_192.168.1.112 (reportingserver_qsadmin)';

/*****Loading data above from MaxDate*****/
T1:
LOAD*;
SQL SELECT *
FROM "MicrosoftDynamicsAX"."dbo"."FbSalesReportAxTable"
where "Invoice Date">=DATEADD(DAY,1,EOMONTH(GETDATE(),-1));
STORE T1 into [lib://Daily QVD (reportingserver_qsadmin)/FbSalesReportAxTable $(vMonth).qvd](qvd);
Drop Table T1;
//Exit Script

/*****Concatenate Old QVD*****/
T2:
LOAD
*
FROM [lib://History QVD (reportingserver_qsadmin)/FbSalesReportAxPOSTable.qvd]
(qvd) where floor([Invoice Date])<=$(vLastMonth);

 

//exit Script

Concatenate(T2)

LOAD
*
FROM [lib://Daily QVD (reportingserver_qsadmin)/FbSalesReportAxTable $(vMonth).qvd]
(qvd) ;
//where not Exists([Invoice Date]);

//exit Script;

STORE T2 into [lib://History QVD (reportingserver_qsadmin)/FbSalesReportAxPOSTable_New.qvd](qvd);

exit Script

Labels (1)
1 Reply
Mario_De_Felipe
Creator II
Creator II

Hi @Gaurav_Kapoor,

I think is better practice using the same condition to load the new and historic registers:

In the T1 table: where "Invoice Date">=DATEADD(DAY,1,EOMONTH(GETDATE(),-1)); why don't you use "Invoice 'Date">='$(vLastMonth)?