Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
julioarriaga
Creator II
Creator II

How do I store certain fields from a pre-existing table into a qvd

Hi everyone,

I was trying with the following code to store certain selected fields into a qvd, but I wasn't able to make it work. Thanks in advance.

Store DESC_CUENTA3_ER

,DESC_CUENTA4_ER

,DESC_CUENTA5_ER

,DESC_CUENTA6_ER

,DESC_CUENTA7_ER

,ZONA_REZONIFICACION

,DESC_PLANTA

,P_TERRITORIO

,Mes

FROM HECHOS_ER

INTO $(vETL)Estadistico.qvd (qvd);

4 Replies
nagaiank
Specialist III
Specialist III

I presume that the table HECHOS_ER is already loaded and the variable vETL is defined.

Then you may use the following script:

TableName:

NoConcatenate

LOAD DESC_CUENTA3_ER

,DESC_CUENTA4_ER

,DESC_CUENTA5_ER

,DESC_CUENTA6_ER

,DESC_CUENTA7_ER

,ZONA_REZONIFICACION

,DESC_PLANTA

,P_TERRITORIO

,Mes

Resident HECHOS_ER

Store TableName INTO $(vETL)Estadistico.qvd (qvd);

Drop Table TableName;

richard_chilvers
Specialist
Specialist

May need a semi-colon at the end of the LOAD statement and before the STORE?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

That should work just fine. What is the problem you are experiencing? Do you get an error?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

You can even rename your fields while STOREing, as shown by this example:

MyTable:

LOAD * INLINE [

Name, RegNo, Amt

ABCD, 10000, 100

EFGH, 20000, 250

IJKL, 59000, 999

];

STORE Name AS a, RegNo AS b FROM MyTable INTO [.\xyz.qvd] (qvd);

But make sure that in your case, variable vETL contains either nothing or a path without spaces. In the latter case, put the full path between square brackets (as in the example above), or the scripting engine will fall over.

[Edit] Corrected spelling mistakes...