Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
trpatel123
Contributor III
Contributor III

Customer Sorting in QV List Box

I have below List of Countries..

Data:

Load * Inline

[

  Country

  (Not Specified)

  USA

  India

  UK

  Germany

  France

  Canada

];

I want to create a List Box which will sort all Countries according to text format but (Not Specified) should come at last.

How to achieve this?

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

On the Sort pane, check both "Text" and "Expression". Use this for the sort expression:

match(Country,'(Not Specified)')

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

10 Replies
oknotsen
Master III
Master III

Put all values in the correct order and in the list box sort by "load order".

May you live in interesting times!
trpatel123
Contributor III
Contributor III
Author

I can't do that... It is coming from SQL database and I have more than 200 countries.

Not applicable

trpatel123
Contributor III
Contributor III
Author

There is nothing there which can help me in my problem.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

On the Sort pane, check both "Text" and "Expression". Use this for the sort expression:

match(Country,'(Not Specified)')

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

oknotsen
Master III
Master III

What you could do is still create the INLINE table with all the values in the order you like, next load the actual data from the database, next drop that INLINE table, and still end up sorting by load order .

May you live in interesting times!
trpatel123
Contributor III
Contributor III
Author

How can I create an Inline table if I don't know exactly how many and which countries are going to appear from database. Your solution is not the one which could help me. But yes, thanks for your reply !

trpatel123
Contributor III
Contributor III
Author

Hi Rob Wunderlich,

This is what exactly I want. It's working perfectly.

Could you please let me know how it works?

oknotsen
Master III
Master III

Here are 3 ways to create an inline table that does what you need. The actual countries in your dataset is not relevant for every solution.

  • The number of countries in this world is limited to about 250. A few minutes of Google can probably get you a complete list. Wikipedia comes to mind.
  • Alternatively you can load your data once and next make use of the tool you get with the INLINE wizard to simply create an INLINE table that lists all possible values in your data source. It is a matter of selecting the field and importing the data.
  • As a 3rd alternative (when you can't figure out how the previous wizard works) is to simply load your data, create a ListBox for country, export it (already sorted) to XLS, make adjustments if needed to the order, and turn that into an INLINE table.
May you live in interesting times!