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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
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
Luminary
Luminary

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)?