

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorting Alphanumeric values
Hi,
I loaded the following in an inline table:
hold:
LOAD * INLINE [
F1
200240AO
500072CT
BRIDESCT
200270AO
WS1000CT
WS1000RZ
8CS077CT
];<div>
Mark
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's an odd one all right. I note that even using an expression like
=F1
gives the expected sort order.
I think I see a pattern to the sort. The values that start with numbers get stripped starting at the first alpha and the resulting number string is sorted using string sorting rules. So what is being sorted is:


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's an odd one all right. I note that even using an expression like
=F1
gives the expected sort order.
I think I see a pattern to the sort. The values that start with numbers get stripped starting at the first alpha and the resulting number string is sorted using string sorting rules. So what is being sorted is:


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Rob,
you are absolutely right. I vaguely remember reading an announcement that QlikView is adopting "natural sorting" for more logical sorting of mixed strings. For example, the following values:
A1B
A2Z
A9K
A11
A19
will be sorted in this exact order, even though regular "alphabetical sort order" would place 11 before 9...
Oleg


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oleg,
Thanks for the clarification. Looks like the workaround is to use an expression if we want the "ASCIIbetical" sort. This seems to work for chart dimensions as well.
Here's a blog post that explains a "Natural Sorting" algorithm.
http://www.davekoelle.com/alphanum.html
-Rob
