Skip to main content

# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Cloud Maintenance is scheduled between March 27-30. Visit Qlik Cloud Status page for more details.
cancel
Showing results for
Search instead for
Did you mean:
Contributor III

## Sort by expression two differents numbers format

Hello everyone,

So I'm trying to sort two different "format" of numbers inside a single column. I'll give you a sample to make it clearer. Let's say I have the following numbers:

```9710364400096944002021
97103744002022
971047```

Now, let's say I sort them in ascending order, I get the following sorting:

```971036971037971047
44000969
44002021
44002022```

Which of course makes sense, but I'm trying to order them in this way:

```44000969
44002021
44002022
971036
971037
971047```

Is there any way to do that in Qlik Sense? I'm guessing I'll have to use the "Sort by expression" option, but I can't seem to think up the syntax for what I'm trying to do. Is there any way to do this? Keep in mind that there are way more numbers than the example I gave, so I can't "hardcode" the order for the numbers with something like that:

`MATCH(Article, '44000969', '44002021', '44002022', '971036', '971037', '971047')`

Any help would be greatly appreciated,

Thank you,

LesJean

1 Solution

Accepted Solutions
MVP

If the length of two set of numbers stay the same, you can try this

1) Sort by Expression Descending -> Len(Num)

2) Sort by Numeric Value Ascending

2 Replies
MVP

If the length of two set of numbers stay the same, you can try this

1) Sort by Expression Descending -> Len(Num)

2) Sort by Numeric Value Ascending

Specialist II
what's the logic for your sort? its not descending.
If these are "intelligent" numbers, meaning the "4400" is a prefix indicating something, you could use string functions to parse out the pieces and sort.
Tags
Community Browser