Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

ORDER BY

greetings

I have a QVD file i need to order the fields names by ABC

any simple way to do this???

Thanks

8 Replies
MK_QSL
MVP
MVP

Load * From [QVDName.qvd]

(qvd)

Order By ABC;

if you want in desc order

Order By ABC Desc;

maxgro
MVP
MVP

this is an example, adapt to your qvd

Directory;

Tmp:

LOAD Name,    Address

FROM Name.qvd (qvd)

//order by Name              this doesn't work

;

Final:

NoConcatenate Load   *

resident Tmp

order by Name;

drop table Tmp;

from online help

order by is a clause used for sorting the records of a resident table before they are processed by the load statement. The resident table can be sorted by one or more fields in ascending or descending order. The sorting is made primarily by numeric value and secondarily by national ASCII value. This clause may only be used when the data source is a resident table. The ordering fields specify which fields the resident table is sorted by. The field can be specified by its name or by its number in the resident table (the first field is number 1).

Anonymous
Not applicable
Author

i don't need the sort on the records but on the table fields

abdc
adambrotherboy23

i need the QVD file to be

abcd
adambrother23boy

first a - b - c- d-  and not a-b-d-c-

swuehl
MVP
MVP

Why do you need to sort the field names?

In general, you can just state the order in your load, instead of using the star symbol *:

LOAD

     a,

     b,

     c,

     d

FROM YourFile.qvd (qvd);

Anonymous
Not applicable
Author

i know but the problem is i have about 30 tables and each table has more that 150 fields so arranging them manually wont work

tresesco
MVP
MVP

Extract them in excel and sort there; copy-paste the sorted fields back in qv script.

er_mohit
Master II
Master II

Temp:

load * from qvd;

noconcatenate

Final:

load * resident Temp

order by fieldname;

drop table Temp;


Anonymous
Not applicable
Author

i need the order by on the fields not the field values