Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Arranging values in specific order in a table in qlikview

Is it possible to arrange the values in a column in a specific order irrespective of the value on the right side(like hard coding the order the table value should appear).For example I want to show the name of countries in a order "India','UK','Australia','Canada','USA'", irrespective of the count value.Below i had attached sample qlikview to demonstrate my requirement

7 Replies
PrashantSangle

Go to Property->sort ->select Country->select Sort by Expression-> write

Match(Country,'India','UK','Australia','Canada','USA')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
vinod2086
Creator II
Creator II

Hi Adam,

what you are expecting am not understanding clearly.

as per my understanding u want to display country in ascending order?

in this case go to properties select sort tab,

here you need to select country and select Text check box and then u select which order u want (a->z r Z->A)

so that values will display. if my assumption is wrong please mention clearly what you are expecting.

vijetas42
Specialist
Specialist

Hi

You can write expression in sort tab like,

if(only({1}Country)={'India'},11,if(only({1}Country)={'UK'},22,if(only({1}Country)={'Australia'},33,if(only({1}Country)={'Canada'},44,if(only({1}Country)={'USA'},55)))))

Thanks,

Vijeta

Anonymous
Not applicable
Author

To make it generic and scalable, would suggest create an excel (or inline table) mapping with the two columns

Country, CountrySortOrder

India, 1

UK, 2

Australia, 3

Canada, 4

USA, 5

load it into your data model. And finally in your table/listbox Sort using expression = CountrySortOrder

Any changes/additions required, can easily be managed by just changing this mapping table.

Siva_Sankar
Master II
Master II

Hi RyanAdam,

You can do this either by custom sort using dual or using the load order. check out the below url . Explained with example.

http://www.qlikfix.com/2010/12/27/creating-a-custom-sort-order-load-order-dual/

Not applicable
Author

Hi thank you for the help

Your solution works fine for pivot tables and its not properly working for straight tables

awhitfield
Partner - Champion
Partner - Champion

Hi Ryan,

I've just tried the solution provided by max dreamer and it seems to work ok on the straight table in your qvw

Andy