Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
brindlogcool
Creator III
Creator III

Alpha Numeric sorting

Hi,

I have a concatenated column of customer code and customername and trying to sort it. It is not working fine.

The column values are like this

Customer_code

001(SSSS)

003(AAAA)

004(PPPP)

I tried to sort through load script, Expression but either of this is working. it is always sorting by numerical values.

If try with Text and Numerical Value in the sort but it takes the numbers as the precedence.

6 Replies
rustyfishbones
Master II
Master II

How many value do you have?

What way do you need it sorted?, above you have it sorted by Customer Code, I assume all customer Codes and Customer Names are unique.

So you will always have numbers and text so therefore you need to decide by which you want to sort

rustyfishbones
Master II
Master II

Did you try concatenating the Customer Code and Customer Name the other way round


customername& '-' &customercode


and then try sort

Not applicable

You can bring the concatenated column and the column with only the code and place the order by the command code column.

The object you sort by load order.

brindlogcool
Creator III
Creator III
Author


I tried all the above options but it is still taking the number as the precedence.

@Alan - it is dynamic and keep changing.So we cannot say it as predefined numbers

Not applicable

I think one option may be generating an ordenation field. First Load the table in codename order.

// This will create a table with secuential order number for each customername

Table_temp:

LOAD ......, Autonumber(customername) customername_order  RESIDENT TABLE order by customername;

// This will create a table with a numeric field ordered by first customername and then customernumber.

Table_final:

LOAD *,  customername_order & customernumber as order, RESIDENT Table_temp;

Expect that helped you.

Ken_Thomas
Former Employee
Former Employee

I know this is an older post, but I updated an article which attempts to explain the algorithm for sorting of alphanumeric data in Qlik: https://support.qlik.com/articles/000005509
 
-Ken