Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
DEMONIO_AZUL
Contributor III
Contributor III

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

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
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

View solution in original post

3 Replies
marksouzacosta

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
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

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 III
Contributor III
Author

Thanks, this works!