Sort order in Datasets

While I’m at it before summer vacation:

When trying to sort datasets by a certain column, you should type in some MySQL code, and I’ve tried “ORDER BY |col| ASC” and I’ve tried just the columns name ASC, but all it does is leave everything blank. Nothing shows. When I erase the code the dataset shows up again sorted as inputed.

Anyone that can point out my error? :wink:

For ascending order try to put only column name in Order field:
ex - Col1
for descending order you need to put DESC
ex - Col1 DESC

I hope it will help you :smile:

When trying to sort numbers xibo shows like this;

1,10,11,111,12,2,20,3

how can i sort like 1,2,3,10,11,12,20,111?

thanks

Hi Alper!

All data is stored as a string and the sort order is alphabetical, ie 40, 60, 80, 100 would result in this output: 100, 40, 60, 80 (because “1” comes before “4”).
Please try to prefix the narrower numbers with spaces so that they contain the same number of characters as the widest number. i.e. “40”,“60”,“80” become " 40", " 60", " 80". etc.for “2” you need to add 2xspace (assuming widest number is xxx)
Note: “100” being the widest, needs to remain “100”.

I hope that makes sense to you

1 Like

01
02
03

Or if you need hundreds:

001
002
010
020
100

As an alternative until we get datatypes working correctly you could add a formula column like:

CONVERT(`otherColumn` AS UNSIGNED INTEGER)

And then sort by that column.

@dan i’ve tried your suggestion but it doesn’t works.