Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
gerhardl
Creator II
Creator II

Store Into txt file with specific sort order

Hi,

If I load from multiple text files and then store that table into one text file, can I choose the sort order of the new txt file?

TEST_TABLE"

LOAD

Field 1,

Field 2,

Field 3

FROM [Path.txt]

(txt, codepage is 1252, embedded labels, delimiter is '~', msq);

STORE 'TEST_TABLE' into [TEST_TABLE.txt] (txt, codepage is 1252, embedded labels, delimiter is '~', msq);

In my TEST_TABLE.txt file I want to sort by Field 3 alphabetically for instance.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

TEMP_TEST_TABLE:

LOAD

[Field 1],

[Field 2],

[Field 3]

FROM [Path.txt]

(txt, codepage is 1252, embedded labels, delimiter is '~', msq);

TEST_TABLE:

NOCONCATENATE

LOAD * RESIDENT TEMP_TEST_TABLE ORDER BY [Field 3];

STORE 'TEST_TABLE' into [TEST_TABLE.txt] (txt, codepage is 1252, embedded labels, delimiter is '~', msq);


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Not applicable

Hi,

what about loading temporary table with ORDER BY Field 3 before using STORE statement?

Gysbert_Wassenaar

TEMP_TEST_TABLE:

LOAD

[Field 1],

[Field 2],

[Field 3]

FROM [Path.txt]

(txt, codepage is 1252, embedded labels, delimiter is '~', msq);

TEST_TABLE:

NOCONCATENATE

LOAD * RESIDENT TEMP_TEST_TABLE ORDER BY [Field 3];

STORE 'TEST_TABLE' into [TEST_TABLE.txt] (txt, codepage is 1252, embedded labels, delimiter is '~', msq);


talk is cheap, supply exceeds demand