Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
Did you try concatenating the Customer Code and Customer Name the other way round
customername& '-' &customercode
and then try sort
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.
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
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.
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