Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
draghici1109
Creator
Creator

Store a table in a text file without the header

Greetings from Freiburg in SW Germany!

I want to store a table in QV/QS in a text file format, like this:

STORE Test INTO [..\DATA\PROFIS\ERGEBNISSE\$(vPraefixDateiName)-test_ohne_header.txt](txt,delimiter is ';');

If I do so, Qlik will store also the header (name of the columns), like in the screenshot bellow:

draghici1109_0-1704811143290.png

I want to store the table without the first line containing the header (column names, separated by 😉

Many Thanks in advance!

Alexandru

Alexandru Draghici
BICC at Komm.ONE
Labels (2)
1 Solution

Accepted Solutions
anat
Master
Master

you may give a try by  running  the  script by using Execute command.

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

but we dont have direct feature 

View solution in original post

5 Replies
Or
MVP
MVP

As far as I know, that's not an option from within the script. You might be able to achieve something like this using Automations in SaaS. As a possible workaround in the script, you could peek at the first value of each field, use that as the field name for a separate load where you read everything *except* the first line, and then Store that. You'd end up with the first line replacing the header row, which I think would achieve the same thing as storing without the header?

draghici1109
Creator
Creator
Author

Thank your for your answer.

We use Qlik on premise. 

I understand your workaround, yet it would cost me to much time to write the code. I am speaking about 60 Tables from SAP FI, and each table has sometimes a few dozen of fields... 

Do you have be accident a sample code for this?

Alexandru Draghici
BICC at Komm.ONE
anat
Master
Master

you may give a try by  running  the  script by using Execute command.

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

but we dont have direct feature 

draghici1109
Creator
Creator
Author

I had a similer project with the same issue. I solved with the execute command and using some DOS-commands

Alexandru Draghici
BICC at Komm.ONE
marcus_sommer

Beside this you may do it with less code in Qlik with something like:

for f = 1 to nooffields('t')
   map: mapping load fieldname($(f), 't') as Lookup, peek(fieldname($(f), 't'), 0, 't') as Return
   autogenerate 1;
next
 
x: load * resident t where recno() > 1; 
rename fields using map; store x into x.txt (txt); drop tables x;
 
which might be also wrapped within a loop over all tables and outsourced in a routine which is fetched per include-variable ...