Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting Issue in Current Selection Box.

Guys here is my issue:

I have filter called Country.I am using a mulitbox for this in which I have sorfted it TEXT "A-Z".

List of countires has been sorted in the multibox but the values of the same field "country" in not sorted in the Current selection box.

Why is it so?

I have attached two imges for your review: One from Multibox and one from Current Selection Box.

Please advise.

Thanks,

TA

9 Replies
Gysbert_Wassenaar

As far as I know the currentselections box sorts the data in the order it was loaded. Unfortunately there seems to be no way to change the sorting order in the currentselections box other than doing the sorting in the load script.


talk is cheap, supply exceeds demand
Not applicable
Author

How can I sort the values in script statement/load script?

Gysbert_Wassenaar

Use an order by clause:

Temp:

Load Region, SalesPerson, Date, Product, Amount, Sales

from test.qvd (qvd);

Result:

Load * resident Temp

order by Region, SalesPerson, Date desc;

Drop Table Temp;

This will sort the data loaded from test.qvd first by Region ascending and SalesPerson ascending and then by Date descending.

edit: fixed a mistake using order by on a non-resident table


talk is cheap, supply exceeds demand
Not applicable
Author

Can you send me an example of that?

I have mulitple fields in one QVD and I just want to sort only one field not the complete set of data. How I can write a loda statment for only one field?

Thanks,

Not applicable
Author

Hi Gysbert,

I have the same problem.

So I tried your advise. But , unfortunately it did not work for me.

My script is:

TempNetworkDomainData:

LOAD *

FROM D:\QlikView\YbrantDigital\Qvd\sql_data\DAILY_ADX_4_2_2013.qvd(qvd) order by company;

concatenate

LOAD *

FROM D:\QlikView\YbrantDigital\Qvd\sql_data\DAILY_RA_4_2_2013.qvd(qvd) order by company;

I wanted to order by company, because it is not sorted in current selection despite the fact it is sorted in multi selection.

But while I reload the model I am getting error :

Garbage after statement

TempNetworkDomainData:

LOAD *

FROM D:\QlikView\YbrantDigital\Qvd\sql_data\DAILY_ADX_4_2_2013.qvd(qvd) order by company

What should I do?

Thanks,

Inna.

Gysbert_Wassenaar

Inna, I made a mistake. Order by can only be done on a resident load. So first load your data into a table and then do another resident load from that table with the order by clause. I've fixed the code above.


talk is cheap, supply exceeds demand
Not applicable
Author

Sorting in selection box is controlled by settings in [Document Properties/Sort]

t_witzgall
Partner
Partner

Thanks a lot, Jerrik.

This solved our problem!

pravinkumar_s
Partner
Partner

Where can I find that in Qliksense? In Qliksense it is always alphabetically sorted.