Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
greetings
I have a QVD file i need to order the fields names by ABC
any simple way to do this???
Thanks
Load * From [QVDName.qvd]
(qvd)
Order By ABC;
if you want in desc order
Order By ABC Desc;
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).
i don't need the sort on the records but on the table fields
a | b | d | c |
adam | brother | boy | 23 |
i need the QVD file to be
a | b | c | d |
adam | brother | 23 | boy |
first a - b - c- d- and not a-b-d-c-
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);
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
Extract them in excel and sort there; copy-paste the sorted fields back in qv script.
Temp:
load * from qvd;
noconcatenate
Final:
load * resident Temp
order by fieldname;
drop table Temp;
i need the order by on the fields not the field values