Dynamic columns formatted as number sorting as strings

Hello! I've got a handful of dynamic columns whose format is dynamically set to 'number' that are sorting as strings.

If I use auto-format, some of them end up formatted as percent, which I don't want.

Am I just assigning the 'number' format incorrectly in my ternary here?

Thanks in advance!

Hello @christophrico!

That is very odd that the values are being sorted as strings, your ternary looks correct from my initial glance.

The one issue might be that from the screen shot it looks like you are in the advanced settings for the whole table. You should be able to click on the specific column name in the inspector panel and then set the format for that column to be numbers.

Let me know if that works!

One other option to get them converted to numbers would be to add that logic into the 'Transform results' block below the query.

You can use some Javascript to grab the values by their row and convert all of them to numbers which should reflect in the table.

1 Like

Thanks! Formatting the values to Number() in the transformer worked! I couldn't format the individual columns because they're dynamic -- but this is a great solution.

1 Like