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

What script to use to convert QVDs into CSV files?

Hi I have a couple of QVDs that i need converted into CSV files, but not sure how to grab them all at once

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Load your table into a Qlik resident table, then use the FOR EACH loop with a FieldValueList, something like

TMP:

LOAD A FROM FileList.xlsx (...);

FOR EACH vFile in FieldValueList( A )

...

NEXT vFile

DROP TABLE TMP;

View solution in original post

9 Replies
jheasley
Luminary Alumni
Luminary Alumni

Try this - obviously youll need to substitute some actual names and locations.

[TableName]:

Load

*

From [QVD LOCATION];

Store [TableName] into [FileLocation/filename.csv](txt);

Drop table [FileName];

swuehl
MVP
MVP

You can use a FOR EACH ... NEXT loop to iterate the above script over all available QVDs, see

https://help.qlik.com/en-US/qlikview/November2018/Subsystems/Client/Content/QV_QlikView/Scripting/Sc...

periclesgt
Contributor
Contributor
Author

Thanks this is great , the list of QVDs names  that I need to grab is an excel doc, like this:

and that is where my issue is , i need to pick up just those QVDs from a folder of 100000 QVDs. Could you please point me to the right direction ?

QVD Names.png

swuehl
MVP
MVP

Load your table into a Qlik resident table, then use the FOR EACH loop with a FieldValueList, something like

TMP:

LOAD A FROM FileList.xlsx (...);

FOR EACH vFile in FieldValueList( A )

...

NEXT vFile

DROP TABLE TMP;

periclesgt
Contributor
Contributor
Author

Thanks,

I think that i am Close now but still not working,

here is my code, what am i doing wrong?

QVD LIST.png

swuehl
MVP
MVP

What do you get when you run the code? An error? If your file name contain spaces, you need to quote the file name in the FROM and STORE statements.

And it may be better to use a TMP table and DROP it in each iteration.

Something like

FOR each vFile in FieldValueList(TargetQVDs)

TRACE File = $(vFile);

TMP:

LOAD * FROM [$(QVDRoot)\$(vFile).qvd] (qvd);

STORE TMP into [$(QVDRoot)\$(vFile).csv] (txt, delimiter is '|');


DROP TABLE TMP;


NEXT vFile

periclesgt
Contributor
Contributor
Author

Hey do i have to define the vFile variable?

periclesgt
Contributor
Contributor
Author

Still Not working BTW , I am losing Hope lol

swuehl
MVP
MVP

Please describe a bit more detailed what you mean with 'not working'.

Check that the loop is performed, each file name should be printed out using the TRACE statement.

Are the TMP tables loaded?

Are the csv files created?

Just stating 'doesn't work' is not helping us to help you.