Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
How to add new column into existing qvd file?.
For ex,
I have 3 years data into Customer_qvd.qvd (qvd) file in production server, in this qvd file contain Customer_ID,Customer_name,Location,Region_CD …. Reporting purpose now I want add new column in this qvd file.
When I am adding new column before taking backup and new creating new qvd file, now how load data from old qvd file to new qvd file(qvd to qvd) and how fill the value into new column.Here no data source getting data from like oracle,sql. Cusomer_qvd file maintain historical data.
Regards.
raja.
Use mapping functions to add the new column.
// create the mapping table
NewDataMap:
Mapping load
Customer_ID,
New_field
From <new data source> ;
//reload data and add new column
Customers:
LOAD *,
Applymap('NewDataMap', Customer_ID) as NewFieldName
From Customer.QVD (qvd) ;
//save updated data to qvd
Store Customers into Customer.qvd (qvd) ;
Hi All,
Please assit above question.
How to load data into one qvd file another qvd file..
Regards,
Raja.
Load Customer.qvd first, then do inner join on CustID. Assuming CustId will be unique key to make link between both qvds.
Then re-create customer qvd with final table created after joining necessary data from second table.
Hi,
Try like this
DataFromQVD:
LOAD
*,
1 AS New Column
FROM Data.qvd;
STORE DataFromQVD into Data.qvd;
Regards,
Jagan.
Hi Jagan,
Good Idea, thank you so much.
But i want fill data into new_column also please help me.
Regards,
raja.
Hi,
Can you come up with a sample data and your expected output, it helps in understanding the scenario.
Regards,
Jagan.
Hi Jagan,
That new column adding into hard code value something like “this is reference ID” for all rows. Here no conditional(like where class) at all.
Regards,
Raja.
Hi,
Try like this
DataFromQVD:
LOAD
*,
“this is reference ID” AS New Column
FROM Data.qvd;
STORE DataFromQVD into Data.qvd;
Regards,
Jagan.
Use mapping functions to add the new column.
// create the mapping table
NewDataMap:
Mapping load
Customer_ID,
New_field
From <new data source> ;
//reload data and add new column
Customers:
LOAD *,
Applymap('NewDataMap', Customer_ID) as NewFieldName
From Customer.QVD (qvd) ;
//save updated data to qvd
Store Customers into Customer.qvd (qvd) ;
If the new column is just Hard coded value , why you need another big qvd in the first place ?
You can use existing qvd for both purposes.