Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I want to execute incremental load. The script is attached below
Incremental (in script )
//store POS_Master_final into
Pos_master(in scrip)(once this file has been created then again its loaded and the script is executed so please confirm is this a right way to do ?)
//POS_Master:
//Load
//ETPCode,
//[inv no],
//Sold_Date,
//Sold_Month,
//Sold_Year,
//itemnumber,
//[Season Code],
//quantity_sold,
//[sales price],
//[inv value],
//[tax amount],
//[Inv val Bucket],
//[return no],
//quantity_returns
////quantity_received,
////First_Received_Date
//FROM
//D:\Data\Final QVD\Final\POS_Master_incremental.qvd (qvd)
//where Sold_Date <= MakeDate(2015,02,28) and NOT WildMatch(ETPCode,'*ETP*','N*N','N*');
/*
Last_Updated_Date:
load
max(Sold_Date) as Max_Date_Sales
RESIDENT POS_Master;
Let Last_updated_Sales_date = DATE(peek('Max_Date_Sales',0,'Last_updated_Sales_date')+1,'YYYYMMDD');
*/
/*
Store_Mapping:
Load
*
FROM
D:\Data\Final QVD\Final\Store_Mapping.qvd (qvd);
*/
When you say these are the fact tables, Then what does this is? POS_Master_final
Orders:
LOAD
[0SOLD_TO:0SOLD_TO] as SAPCode_Order,
[0MATERIAL:0MATERIAL]&[0AF_COLOR:0AF_COLOR]&[0AF_SIZE:0AF_SIZE] as itemnumber,
left([0MATERIAL:0MATERIAL],3) as [Season Code],
[0CONF_QTY:0CONF_QTY] as quantity_order,
[Z_MRP_INR:Z_MRP_INR] as Sales_price_order,
([Z_WSP_INR:Z_WSP_INR]/[0CONF_QTY:0CONF_QTY]) as WS_price
FROM
(
SAPCode_Orders:
Mapping LOAD
@2 as SAP_Trans_code,
@3 as SAPCode_Order
FROM
(
Material_Orders:
Mapping Load
@2&'N'&@3 as Material_Trans_code,
trim(@7) as Material
FROM
(
SAP_LEVEL:
LOAD @2 as SAP_Trans_code,
@2&'N'&@3 as Material_Trans_code,
@7 as Color_Size,
@12 as quantity_order,
@15/@12 as WS_Price
FROM
(
where @6='';
SAP_LEVEL_Final:
Concatenate(Orders)
Load
ApplyMap('SAPCode_Orders',SAP_Trans_code,'-') as SAPCode_Order,
ApplyMap('Material_Orders',Material_Trans_code,'-')&Color_Size as itemnumber,
Left(ApplyMap('Material_Orders',Material_Trans_code,'-'),3) as [Season Code],
applymap('MRP_temp',ApplyMap('Material_Orders',Material_Trans_code,'-')&Color_Size,'-')*quantity_order as Sales_price_order,
quantity_order,
WS_Price
Resident SAP_LEVEL;
drop table SAP_LEVEL;
Temporary:
mapping LOAD SAPCode as SAPCode_Order,
ETPCode
Resident Store_Mapping ;
Orders_temp:
load SAPCode_Order,
[Season Code],
itemnumber,
quantity_order,
Sales_price_order,
WS_price,
applymap('Temporary',SAPCode_Order,'Others') as ETPCode
resident Orders;
drop table Orders;
Orders_temp2:
left keep (Temp)
load
*
resident Orders_temp;
drop table Orders_temp;
Orders_data:
//Concatenate(POS_Master)
load
SAPCode_Order,
[Season Code],
itemnumber,
quantity_order,
Sales_price_order,
ETPCode
resident Orders_temp2;
Pos_Master_temp:
load *,
itemnumber&ETPCode as Key
resident Orders_data;
WS_Mapping:
mapping load itemnumber&ETPCode as Key,
WS_price
resident Orders_temp2;
POS_Master_final:
load *,
applymap('WS_Mapping',Key,'-') as WS_Cost
resident Pos_Master_temp;
//drop table POS_Master;
drop table Orders_data;
drop table Pos_Master_temp;
drop table Orders_temp2;
This is executed before incremental load
Okay, Seems working as expected until here. So, My question here is What is the business to use Increment Load over here? Can you attach Data model too?
can you please help?