Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
kishorj1982
Creator II
Creator II

Data mistmatch after QVD creation

Hi All,

 

I am creating QVD for table but after reloading created QVD in next level there is data mismatch issue.

Could you please assist me.

Below is the piece of code for this.

 

DIRECTORY $(RootFolderForInputQVD);

//CONCATENATE (Data)
Data_Sales_Order:
LOAD // Key fields
// If Item Category is 'ZTAC', 'ZTAK' or 'ZTRO' retrieve Material from ZSD_REELS using Plant and Material Entered
If (Match ([%Item category_ITEM_CATEG], 'ZTAC', 'ZTAK', 'ZTRO'), ApplyMap ('ZSD_REELS Map', [%Plant_PLANT]& ' ' & [Material Entered], [%Material_MATERIAL]), [%Material_MATERIAL]) as [%Material_MATERIAL],
[Sales Document Item Key],
[Sales Document Item Key] as [Sales Document Item Count],
//AutoNumber ([Sales Document Item Key], 'Date Key') as [Date Key],
[Sales Document Number],
[Sales Document Number] as [Sales Document Number Count],
[Sales Document Item],
[%CO_AREA_PROFIT_CTR],
[%Company code_COMP_CODE],
[%Distribution Channel_DISTR_CHAN],
[%Division_DIVISION],
[%Sales doc. type_DOC_TYPE],
[%Item category_ITEM_CATEG],
[%Material group_MATL_GROUP],
[%MaterialGroup 1_MATL_GRP_1],
[%MaterialGroup 2_MATL_GRP_2],
[%MaterialGroup 3_MATL_GRP_3],
[%Parts Reporting Group_MATL_GRP_3] as [%Parts Reporting Group],// Used as [%MaterialGroup 3_MATL_GRP_3] in Parts Sales & Deliveries.qvw
[%MaterialGroup 4_MATL_GRP_4],
[%MaterialGroup 5_MATL_GRP_5],
[%Reason for order_ORD_REASON],
[%Plant_PLANT],
[%PLANT_MATERIAL],
[%Reason for rejection_REASON_REJ],
[%Reason for substitution_SUB_REASON],
[%Ship-to Sales District_SALES_DIST],// as '%Sales District_SALES_DIST', //BI-2516 - xrantsju - 20180605 - Sales District is changed back to derived from Sold to Party in SD New.
[%Sales District_SALES_DIST], //BI-2516 - xrantsju - 20180605 - Sales District is changed back to derived from Sold to Party in SD New.
[%Sales Office_SALES_OFF],
[%Sales Representative_SALESEMPLY],
[%Sales Organization_SALESORG],
[%Shipping point_SHIP_POINT],
[%Sold-to Party_SOLD_TO],
[%Ship-To Party_SHIP_TO],
[%Bill-to party_BILLTOPRTY],
[%WBS Element_WBS_ELEMT],
[%Prod.hierarchy_PROD_HIER_1],
[%Prod.hierarchy_PROD_HIER_2],
[%Payer_PAYER],
[%Trading Partner_ZVBUND],
// [%Delivery priority_DLV_PRIO],
// [%Shipping Type_SHIP_TYPE],
// [%Service Branch_/BIC/ZIKSDSB1],
[%Partner profit center_PART_PRCTR],
[%CO_AREA_PROFIT_CTR_BILLING],
[Internal Reference],
// Mappings
ApplyMap ('Sales Brand Map', [Sales Document Item Key], ' ') as [Sales Brand],
ApplyMap ('Loading Point Map', [Sales Document Item Key], ' ') as [%Loading point_LOAD_PT],
ApplyMap ('Delivery Status Map', [Sales Document Item Key], 'A') as [%Delivery Status_DLV_STS],
ApplyMap ('Schedule Line Category Map', [Sales Document Item Key], ' ') as [%Sched.line category_SCHD_CATEG],
ApplyMap ('First OCMC Date Map', [Sales Document Item Key], 'N/A') as [First OCMC Date],
ApplyMap ('OTCC Date Map', [Sales Document Item Key], 'N/A') as [OTCC Date],
ApplyMap ('First OTCC Date Map', [Sales Document Item Key], 'N/A') as [First OTCC Date],
ApplyMap ('Planned Delivery Date Map', [Sales Document Item Key], 'N/A') as [Planned Delivery Date],
ApplyMap ('Confirmed Delivery Date Map', [Sales Document Item Key], 'N/A') as [Confirmed Delivery Date],
ApplyMap ('Required Goods Issue Date Map', [Sales Document Item Key], 'N/A') as [Required Goods Issue Date],
ApplyMap ('Goods Receipt Date Map', [Sales Document Item Key], 'N/A') as [Goods Receipt Date],
ApplyMap ('Order List Price LC Map', [Sales Document Item Key], 0) as [Order List Price LC],
ApplyMap ('Order List Price DC Map', [Sales Document Item Key], 0) as [Order List Price DC],
If (ApplyMap ('Sold-to Country Map', [%Sold-to Party_SOLD_TO], 'No Sold-to Country') = ApplyMap ('Company Country Map', [%Company code_COMP_CODE], 'No Company Country'), 'Domestic', 'Export') as [Domestic/Export],

[Credit Status],
[Profit Center Sales Document Item Key],
[Complete Delivery],
[Sell and Lease Back Order],
[Parts Brand],
[Siebel Document Number],
[Service Request Number],
ApplyMap ('Sales Document Header Medium Description Map', ApplyMap ('Reference Document Map', [Sales Document Number], Null ()), 'N/A') as [Service Agreement Number],
If ([Service Request Number] <> ' ', 'SR-' & [Service Request Number], ApplyMap ('Sales Document Header Medium Description Map', ApplyMap ('Reference Document Map', [Sales Document Number], Null ()), 'N/A')) as [Siebel Key],
[Siebel Position Number],
[Sales Document Creation Date],
[Sales Document Date],
[Sales Document Category],
[Customer Purchase Order Number],
[Customer Purchase Order Item],
[Customer Material Number],
[Material Entered],
[Base Unit],
[Group Currency],
[Local Currency],
[Document Currency],
[Parts Portal Web Number],
[Parts Portal Web Number Exists],
[Project No],
[Customer Reference],
[Crane Serial Number],
[Target Price LC],
[Target Price DC],

// Figures
[Order Confirmed Quantity BU],
[Order Confirmed Quantity SU],
[Order Quantity SU],
[Order Subtotal 1],
[Order Subtotal 2],
[Order Subtotal 3],
[Order Subtotal 4],
[Order Subtotal 5],
[Order Subtotal 6],
[Order Net Value],
[Order Net Value LC],
[Order Net Value GC],
[Order Subtotal 1 LC],
[Order Subtotal 2 LC],
[Order Subtotal 3 LC],
[Order Subtotal 4 LC],
[Order Subtotal 5 LC],
[Order Subtotal 6 LC],
[Order Cost],
[Order Cost LC],
[Order Cost GC],
ApplyMap ('Purchasing Document Type Map', [Sales Document Number], ' ') as [%Purchasing document type_DOCTYPE],
IF(trim([%Material group_MATL_GROUP])='M00' AND left(trim([%MaterialGroup 1_MATL_GRP_1]),1)='1',1,0) as [Order Crane Quantity], //BI-2872 -PN-Tieto
[Delivery Group],
'SalesOrder' as QVDsource
FROM
[SalesOrder.qvd] (qvd)
// Do not retrieve offers (sales document types ZQT and ZQH)
WHERE Match ([%Sales doc. type_DOC_TYPE], 'ZQT', 'ZQH') = 0
// Removing Stahl data
AND [%Company code_COMP_CODE] <> 'CN05' AND [%Company code_COMP_CODE] <> 'US04';

DIRECTORY $(VOPTQVD);

store Data_Sales_Order into Data_Sales_Order.QVD(qvd);
drop table Data_Sales_Order;

 

 

I have also attached the file for same.

Thanks

Labels (1)
1 Solution

Accepted Solutions
hopkinsc
Partner - Specialist III
Partner - Specialist III

That's a strange one. 

Is there more to the script or is it just that single table load and nothing else? 

If there is more to it, have you tried running the single table and storing out on its own?

I have never experienced that before, the QVD should contain the data that is in the QVW after the reload. 

View solution in original post

4 Replies
hopkinsc
Partner - Specialist III
Partner - Specialist III

Hi, Are you saying that when you reload the QVW, the data within the QVW after the reload is different to the data that is held in the new QVD created from the reload?

 Are you looking at the correct QVD, you've checked the timestamp of it?

 

kishorj1982
Creator II
Creator II
Author

Yeah, timestamp is same but whenever I am creating QVD for above table and use that created QVD in the next layer dta is not matching.

 

Thanks

hopkinsc
Partner - Specialist III
Partner - Specialist III

That's a strange one. 

Is there more to the script or is it just that single table load and nothing else? 

If there is more to it, have you tried running the single table and storing out on its own?

I have never experienced that before, the QVD should contain the data that is in the QVW after the reload. 

kishorj1982
Creator II
Creator II
Author

There are other tables as well but I experienced problem in below code.

WHERE Match ([%Sales doc. type_DOC_TYPE], 'ZQT', 'ZQH') > 0
// Removing Stahl data
AND [%Company code_COMP_CODE] <> 'CN05' AND [%Company code_COMP_CODE] <> 'US04';

 

I think below code should be better,

WHERE Match ([%Sales doc. type_DOC_TYPE], 'ZQT', 'ZQH') 
// Removing Stahl data
AND [%Company code_COMP_CODE] <> 'CN05' AND [%Company code_COMP_CODE] <> 'US04';

 

I have loaded QVD's separately one for direct load from QVD and another for after creation of Transformed QVD and use same QVD in data model.

I do not know but it is strange.