Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Load from QVD then save back to it

Is there a way to load from QVD then save back over the same QVD?  This works when running an incremental style load where I would concatenate a SQL load and QVD load and then store back to that QVD.  However it doesn't work to simply load * from QVD and the store into back to the same QVD.

Just wondering if there is something I would need to do to get around this. (Im sure I could change my approach to stop the save back to QVD if I only load from QVD also).

Tags (5)
6 Replies
manojkvrajan
Contributor III

Re: Load from QVD then save back to it

Yes. It is very much possible to load and save back to the same QVD. Please find attached QVW for your reference.

MVP
MVP

Re: Load from QVD then save back to it

why not? below a small example

try to post your script if it doesn't work

directory;

t: load rand() as r AutoGenerate 100;

STORE t into t.qvd (qvd);

DROP Table t;

// read, add some records, store in same qvd

t: load * from t.qvd (qvd);

load rand() as r AutoGenerate 200;

STORE t into t.qvd (qvd);

bbs
Contributor

Re: Load from QVD then save back to it

Robby,

The only thing that comes to mind here is if you are not changing anything in the data you loaded, I am not sure the store command is going to do anything in that case as the table is unchanged.  I have not tested this myself to be honest, but about the only thing of which I can think that could be in play here the way you have described things. 

One thing you may be able to do in this case is a record count on the load and then if nothing changes, use logic in the store statement to not do the store if the record count has not increased or decreased etc.  Sorry if I am way off-base here, but thought I would toss it out in case it may be applicable.

If you can post your script, that may help as one of the folks above mentioned, as we should be able to better see exactly what you are doing and have a better idea of what could be going wrong then.

Regards,

Brett

Not applicable

Re: Load from QVD then save back to it

IF 1=1 THEN

UNQUALIFY *;

PERF_MGMT_MTH_SUM_QLIK:

LOAD *

  FROM E:\PERF_MGMT_MTH_SUM_QLIK.qvd(qvd)

  WHERE MONTH_KEY<='201405';

ENDIF;

TRACE('End of load statements');

Store PERF_MGMT_MTH_SUM_QLIK into E:\PERF_MGMT_MTH_SUM_QLIK.qvd (qvd);

bbs
Contributor

Re: Load from QVD then save back to it

Robby,

Ok, thanks, that helps a ton, and I think if you change things just a bit, that may do the trick here:

TEMP:

LOAD *

     FROM E:\PERF_MGMT_MTH_SUM_QLIK.qvd(qvd)

(This ensures your QVD loads optimized)    


IF 1=1 THEN

UNQUALIFY *;

PERF_MGMT_MTH_SUM_QLIK:

NOCONCATENATE LOAD *

RESIDENT TEMP;

WHERE MONTH_KEY<='201405';

ENDIF;

.......

Try that and see if it results in different result or not.  This also ensures the QVD should definitely not be in use when you attempt your store statement.  Shout back when you can change things and rerun it.  If this does not do the trick, and you have a license, I would suggest opening a Support case on this issue, but be sure to send us sample QVW and QVD file, so we can run things to see exactly what is occurring here.  Hopefully the above may do the trick though.

Regards,

Brett

Not applicable

Re: Load from QVD then save back to it

Didn't seem to work.  Ill open up a support ticket.

Community Browser