Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
riishabhz
Creator
Creator

incremental tables script explain.

hi can any one please explain me the difference between two scripts :-

first script:-

"NonTest":

LOAD *

FROM

C:\Test\Qvd\NonTest.qvd(qvd);

catenate (NonTest)

SQL select *

FROM "62_DW".dbo."t_test"

where  Date>$(vMaxDate);

STORE "NonTest" INTO '$(vDataQvds)NonTest.qvd' (qvd);

DROP TABLE NonTest;

 

2nd script :-

 

"NonTest":

SQL select *

FROM "62_DW".dbo."t_test"

where Date>$(vMaxDate);

Temp:

load max (Date) as MaxDate

resident NonTest;

let vMaxDate=peek('MaxDate');

drop table Temp;

Concatenate (NonTest)

LOAD *

FROM

C:\Test\Qvd\NonTest.qvd(qvd);

STORE "NonTest" INTO '$(vDataQvds)NonTest.qvd' (qvd);

DROP TABLE NonTest;

which script will work for incremental load , please tell me.

11 Replies
dplr-rn
Partner - Master III
Partner - Master III

from a quick look; your first one looks right for insert only incremental load apart from it missing code to populate variable vMaxDate.

use below link for a good tutorial on incremental load
https://www.analyticsvidhya.com/blog/2014/09/qlikview-incremental-load/
riishabhz
Creator
Creator
Author

Hi sir, can you please share your script of incremental sql, i am in need
sir, please help me
dplr-rn
Partner - Master III
Partner - Master III

Look at #1 in that link that will help you.
riishabhz
Creator
Creator
Author

I tried that link sir, but data is getting double dont know why.
dplr-rn
Partner - Master III
Partner - Master III

share your script.
riishabhz
Creator
Creator
Author

My script :- data is getting double dont know why
max1:
LOAD max (SalesDate) as SalesDate
FROM
[..\VWCashOrderTRN_Qlik\VWCashOrderTRN_Qlik.qvd](qvd);

let date2=Date(peek('SalesDate',0,'max1'));

drop table max1;

final1:
LOAD NCode,
PartnerCode,
Channel,
ETPCode,
SalesDate,
"Doc_Type",
BillNo,
CustomerNumber,
Season,
Style,
Color,
Size,
InvoiceQuantity,
ETPMRP,
RealisedSale,
TAXAmount,
TAXRate,
NETSale,
SalesPerson;
SQL SELECT *
FROM ETPEASV55.dbo."VWCashOrderTRN_Qlik" where SalesDate>'$(date2)';

Concatenate(final1)
LOAD NCode,
PartnerCode,
Channel,
ETPCode,
SalesDate,
Doc_Type,
BillNo,
CustomerNumber,
Season,
Style,
Color,
Size,
InvoiceQuantity,
ETPMRP,
RealisedSale,
TAXAmount,
TAXRate,
NETSale,
SalesPerson
FROM
[..\VWCashOrderTRN_Qlik\VWCashOrderTRN_Qlik.qvd]
(qvd);
dplr-rn
Partner - Master III
Partner - Master III

almost certainly your where clause is not working correctly.
why do you have single quotes around the variable there?
FROM ETPEASV55.dbo."VWCashOrderTRN_Qlik" where SalesDate>'$(date2)';

the overall logic looks correct. you need to make sure the where clause executes correctly
riishabhz
Creator
Creator
Author

Ok, should i use this script or from analyticsvidya. Com which you gave me
to follow the incremental
dplr-rn
Partner - Master III
Partner - Master III

use one from the link