Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to order Excel File In Load Script

hello Dears

I want Order Excel File In Load Script

But Get Error.

Plz Help Me

Populations:

Load *, Num(  Population) as pop;

LOAD Rank,

     [Country (or dependent territory)] as country,

     Date,

     Population,

     [% of world population],

     Source

    

FROM

TB01_20150721_222616.xls ;

16 Replies
manojkulkarni
Partner - Specialist II
Partner - Specialist II

Pls can elaborate what's the requirement. Do you want to sort the excel data ?

Not applicable
Author

no ,i want load Excel File Into Qlikview

And in load Script Order by Country Or Rank ,...

Kushal_Chawda

Something like this

Populations:

Load *, Num(  Population) as pop;

LOAD Rank,

     [Country (or dependent territory)] as country,

     Date,

     Population,

     [% of world population],

     Source

   

FROM

TB01_20150721_222616.xls ;

Population_New:

noconcatenate

load *

resident Populations

order by country;

drop table Populations;

Not applicable
Author

Thanks,

This code is similar to code

But there is still a problem

Populations:

LOAD Rank,

     [Country (or dependent territory)] as country,

     Date,

     Population,

     [% of world population],

     Source

FROM

[https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population]

(html, codepage is 1256, embedded labels, table is @1);

PopulationsOrder:

noconcatenate

Load * resident Populations order by country asc;

Drop table Populations;

---------------------------------------------------------------------------------------

Result Is Not Valid

5.png

Ralf-Narfeldt
Employee
Employee

If you check with preview in the Table Viewer you can see that they have been loaded ordered by country.

But the Table Box you display it in here is most likely set to sort on %population, check the properties.

Not applicable
Author

In your image, you are sorting by '% of world population' as denoted by the ^ arrow on the field.

Using order by affects the load order of the data not the final display order you decide within an object. You need to use 'load order' in the sorting option of the object.

hope that helps

Joe

manojkulkarni
Partner - Specialist II
Partner - Specialist II

Unless there is a specific reason to sort data while loading,it is not necessary to load data in order w.r.t any columns. if you are doing some aggregate at script level then this is necessary.

Otherwise sorting can be done at chart level on different combinations.

Not applicable
Author

I Used Table Box ,only Show Data.

but i want sort in Load Script.(without property in chart)

but But does not apply  correctly

I want a piece of code that I wrote to chart settings have priority (The highest priority With load Or Resident Load)

-----------------------------------------------------------------

Populations:

LOAD

     country,

     Date,

     Population,

     Rank,

     Source

    

FROM TB01_20150721_222616.xls

(biff, embedded labels, table is [Sheet1$]);

PopulationsOrder:

noconcatenate

Load *

resident Populations order by Rank desc;

Drop table Populations;

-----------------------------------------------------------------

7.png

Ralf-Narfeldt
Employee
Employee

Please check in File > Table Viewer, right click on the PopulationsOrder table and select Preview.

There you will see the true load order which should be as specified by Rank in this case.

For the Table Box, right click and select Properties, and go to Sort tab.

make sure that Load Order is the only selected option.

Any other order selected  will override the load order.