Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to archive old data in qvd by record current data in new rows without overwriting old data.
Try like:
Data:
LOAD Article,
Stock,
today () as date
FROM
(ooxml, embedded labels, table is Sheet1);
Set ErrorMode=0;
IF NOT IsNull(QvdCreateTime('Archive_Data.qvd')) THEN
Set ErrorMode=1;
CONCATENATE (Data)
LOAD * FROM Archive_Data.qvd (qvd);
STORE Data INTO Archive_Data.qvd (qvd);
ELSE // This ELSE part can be omitted after first time run
Data:
LOAD * FROM Archive_Data.qvd (qvd);
STORE Data INTO Archive_Data.qvd (qvd);
ENDIF
I am not sure if I follow you correctly or not. QV lets you store data in qvd format which could be referred later for future use. Once you store the data in qvd, it is static. Usually, if you need to add/delete some data to/from it, you have to load the qvd in qv and perform the operation in script and then write back the modified data newly in qvd.
Can you guide the code?
this my code,but it it overwriting old data.
Data:
LOAD Article,
Stock,
today () as date
FROM
(ooxml, embedded labels, table is Sheet1);
///////////////////////////////////////////////////////////////////////////////
Archive_Data:
LOAD *;
IF NOT IsNull(QvdCreateTime('Data.qvd')) THEN
CONCATENATE load(Data);
LOAD * FROM Data.qvd (qvd);
ENDIF
STORE Data INTO Archive_Data.qvd (qvd);
/////////////////////////////////////////////////////////////////////////////
Try like:
Data:
LOAD Article,
Stock,
today () as date
FROM
(ooxml, embedded labels, table is Sheet1);
Set ErrorMode=0;
IF NOT IsNull(QvdCreateTime('Archive_Data.qvd')) THEN
Set ErrorMode=1;
CONCATENATE (Data)
LOAD * FROM Archive_Data.qvd (qvd);
STORE Data INTO Archive_Data.qvd (qvd);
ELSE // This ELSE part can be omitted after first time run
Data:
LOAD * FROM Archive_Data.qvd (qvd);
STORE Data INTO Archive_Data.qvd (qvd);
ENDIF
Thank you very much
It's done
Thank you so much