Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to combine three files into single qvd ?

Hi

I want to combine three csv files into a single quantity

how to do that ?

5 Replies
Anonymous
Not applicable
Author

* QVD

jonathandienst
Partner - Champion III
Partner - Champion III

Load from each QVD using a loop or a wild card load. Use Concatenate if the field lists are not identical. Then store the resulting table as a new, combined QVD.

You may want an extra field to identify the source of the data.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Not clear

I want to combine three individual csv files into single Qvd. the three files which I have to combine are csv files and it does not contain any column header and even the number of columns in all three files are not the same, so is it possible to combine three files into a single QVD? and how?

mdmukramali
Specialist III
Specialist III

Hi Saksham,

If three files are doesn't contain same Data & not same number of Columns then why do you want to combine them into single QVD ?

you have to provide us more detail and sample script or data file

Thanks,

Mukram

Anonymous
Not applicable
Author

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

(
txt, codepage is 1252, embedded labels, delimiter is '|', msq
);

(This above  file was created manually by using below files D:\Data\Order\dwh_VBAK*.txt, and but now this file is missing from my desktop and want to create this file so i want to concatenate all three files and only use those columns which are used in my orders data (as shown above) so is it possible?




SAPCode_Orders:

Mapping LOAD

@2 as SAP_Trans_code,
@3 as SAPCode_Order
FROM

(
txt, codepage is 1252, no labels, delimiter is '|', msq);


Material_Orders:
Mapping Load
@2&'N'&@3 as Material_Trans_code,
trim(@7) as Material
FROM

(
txt, codepage is 1252, no labels, delimiter is '|', msq);


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

(
txt, codepage is 1252, no labels, delimiter is '|', msq)
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;