Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE

Sorting Alphanumeric Data

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
ToniKautto
Employee
Employee

Sorting Alphanumeric Data

Last Update:

May 10, 2022 3:23:50 PM

Updated By:

Jamie_Gregory

Created date:

Dec 1, 2014 10:49:58 PM

QlikView and Qlik Sense do not apply strict alphabetic (ASCII) sort order for alphanumeric values. Instead alphanumeric values are sorted in a natural sort order, where numerical parts are sorted based on their entire numerical value rather than per digit.  

During sorting the alphanumeric string is broken into parts, where a part contains either all alphabetic characters or all numeric characters. These parts are then compared against each other. If both chunks contain numbers, a numerical comparison is used. If either chunk contains characters, the ASCII comparison is used.

For example it means that data like street addresses get sorted in a natural order base don the street number. As shown in the example below the value 8 is considered smaller than 22, base don their numerical values rather than the opposite based on their text values. 

ascending and descending example.png

 

Reference:

Environment

  • Qlik Sense - all releases
  • QlikView - all releases

 

Resolution

 

Strict sort order can be accomplished by reusing loaded data order, which can be controlled by data source for example by applying SQL ORDER BY clause. 

During data load the order can be saved by utilizing the loaded Record Number. 

data load.png

 The loaded record order can then be used as sorting order, by applying it as an expression to sort by.  

loaded record.png

Labels (2)
Version history
Last update:
‎2022-05-10 03:23 PM
Updated by: