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

Export a table from script into txt or csv format file

Hi all,

somebody can help me?

This is my question:

How do I export a table directly from the QlikView script in a txt or csv file?

          Thank all

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Hi Sbuzi,

please take a look at this:

(From the HELP):

Store

A QVD or a CSV file can be created by a store statement in the script. The statement will create an explicitly named QVD or CSV file. The statement can only export fields from one logical table. The text values are exported to the CSV file in UTF-8 format. A delimiter can be specified, see load. The store statement to a CSV file does not support BIFF export.

store [ *fieldlist  from] table   into filename [ format-spec ];

where:

*fieldlist::= ( * | field ) { , field } ) - A list of the fields to be selected.

Using * selects all fields.

field::= fieldname [ as aliasname ]

format-spec ::= ( ( txt | qvd ) )
The format specification consists of a the text txt for text files, or the text qvd for qvd files. If the format specification is omitted, qvd is assumed.

fieldname is a text that is identical to a field name in the table. (Note that the field name must be enclosed by straight double quotation marks or square brackets if it contains e.g. spaces.)

aliasname is an alternate name for the field to be used in the resulting QVD or CSV file.

table is a script labeled, already loaded table to be used as source for data.

filename is the name of the target file. The interpretation of file name is similar to names in load statements, i.e. the directory statements apply.

Examples:

Store mytable into xyz.qvd (qvd);

Store * from mytable into xyz.qvd;

Store Name, RegNo from mytable into xyz.qvd;

Store Name as a, RegNo as b from mytable into xyz.qvd;

store mytable into myfile.txt (txt);

store * from mytable into myfile.txt (txt);

(The two first examples have identical function.)

View solution in original post

3 Replies
swuehl
MVP
MVP

Hi Sbuzi,

please take a look at this:

(From the HELP):

Store

A QVD or a CSV file can be created by a store statement in the script. The statement will create an explicitly named QVD or CSV file. The statement can only export fields from one logical table. The text values are exported to the CSV file in UTF-8 format. A delimiter can be specified, see load. The store statement to a CSV file does not support BIFF export.

store [ *fieldlist  from] table   into filename [ format-spec ];

where:

*fieldlist::= ( * | field ) { , field } ) - A list of the fields to be selected.

Using * selects all fields.

field::= fieldname [ as aliasname ]

format-spec ::= ( ( txt | qvd ) )
The format specification consists of a the text txt for text files, or the text qvd for qvd files. If the format specification is omitted, qvd is assumed.

fieldname is a text that is identical to a field name in the table. (Note that the field name must be enclosed by straight double quotation marks or square brackets if it contains e.g. spaces.)

aliasname is an alternate name for the field to be used in the resulting QVD or CSV file.

table is a script labeled, already loaded table to be used as source for data.

filename is the name of the target file. The interpretation of file name is similar to names in load statements, i.e. the directory statements apply.

Examples:

Store mytable into xyz.qvd (qvd);

Store * from mytable into xyz.qvd;

Store Name, RegNo from mytable into xyz.qvd;

Store Name as a, RegNo as b from mytable into xyz.qvd;

store mytable into myfile.txt (txt);

store * from mytable into myfile.txt (txt);

(The two first examples have identical function.)

Not applicable
Author

Thank swuehl

very, very good

Thank

El_Davidus
Contributor II
Contributor II

I was able to save my file, but all the information was saved in just one column. Is it possible to save using script and get a regular one header one column in csv type file ?