Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

giakoum
Not applicable

Export chart to delimited file using any delimiter and removing headers

Hi all.

I have created a macro that exports a chart to a delimited (txt or csv) file. The Developer can decide which delimiter to use, what file name and how many header rows to omit.

Features :

- File name

- File Type (txt and csv have been tested)

- Output directory

- Delimiter

- Number of header rows to remove

The macro actually exports the chart to a file (with headers), let's call it File1, using the desired delimiter. Then it starts reading through File1, first skipping any header lines, and then each read line is written to File2. Once this is competed, File1 is deleted and File2 is the desired output.

Reading from File1 and writing to File2 line by line, brings up a performance issue. It took approximately 10 minutes on my laptop, to browse through 1 million lines and 4 fields. Not bad, but I think that there must be a way to improve this.

So please feel free to comment, change and improve the attached QVW so that it performs better. Currently it has 10000 lines of data, but this can easily be changed in the script (reload needed after any change): LET vLimit = 10000;

Looking forward to your suggestions!

Thank you.

Giakoumakis Ioannis.

1 Solution

Accepted Solutions
giakoum
Not applicable

Re: Export chart to delimited file using any delimiter and removing headers

Well, either the application is so perfect that there is nothing to comment about or it is so terrible that it is not worth commenting...

2 Replies
giakoum
Not applicable

Re: Export chart to delimited file using any delimiter and removing headers

Well, either the application is so perfect that there is nothing to comment about or it is so terrible that it is not worth commenting...

abm_trevor
Not applicable

Re: Export chart to delimited file using any delimiter and removing headers

Works like a charm, thanks Ioannis.  I was previously doing this though a QlikView export then a separate batch script to remove the headers. This is much more elegant.