Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
DEMONIO_AZUL
Contributor
Contributor

Load numbers before letters

Hello there!

I have a field called "System" that contains the following data: A01,A02,A03, A0x.

No issues loading the data, however, when displaying it -say, a table- it gets displayed as A0x, A01, A02, A03.

A0x should be the last to be shown, not the first. I understand that this is the normal ASCII sequence (letters first).

How can I make the load script to load numbers first? Or at least to show them as required, with A0x at the last position?

Note that A0x may be in whatever place in the list, not necessarily in the first or last position of the table.

Thanks!

Labels (1)
1 Solution

Accepted Solutions
marksouzacosta
Partner - Specialist
Partner - Specialist

Hi @DEMONIO_AZUL,

You can try something like this. 99 is any high arbitrary number you can use that you know for sure no other will be higher than it.

LOAD 
Dual(System,If(Match('x',Right(System,1)),99,Num(Right(System,2)))) as System
INLINE [
System
A0x
A01
A02
A03
];

 

Regards,

Mark Costa

Read more at Data Voyagers - datavoyagers.net

View solution in original post

3 Replies
marksouzacosta
Partner - Specialist
Partner - Specialist

Hi @DEMONIO_AZUL,

You can try something like this. 99 is any high arbitrary number you can use that you know for sure no other will be higher than it.

LOAD 
Dual(System,If(Match('x',Right(System,1)),99,Num(Right(System,2)))) as System
INLINE [
System
A0x
A01
A02
A03
];

 

Regards,

Mark Costa

Read more at Data Voyagers - datavoyagers.net
Anil_Babu_Samineni

You can perhaps sort them that you wish?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
DEMONIO_AZUL
Contributor
Contributor
Author

Thanks, this works!