Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
penpayom
Contributor
Contributor

Can qlikview keep the old data?

I want to archive old data in qvd by record current data in new rows without overwriting old data.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

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

View solution in original post

4 Replies
tresesco
MVP
MVP

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.

penpayom
Contributor
Contributor
Author

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);     

/////////////////////////////////////////////////////////////////////////////

tresesco
MVP
MVP

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

penpayom
Contributor
Contributor
Author

Thank you very much
It's done
Thank you so much