When downloading a table as csv, whitespaces are inserted into the numbers

When I download a table as csv, any column that contains integer values has whitespace inserted between every 3 digits.

ie. the values in the column change as follows:
value metabase -> value in export csv
4245 -> 4 245
55612 -> 55612
12 -> 12
445 -> 445
3445 -> 3 445

see screenshot:

The value artisan_id in our dataset is '3429'
In the display for the table, a space is inserted (for it to be readable?)
In downloading the table, this artificial whitespace is conserved '3 429'

I am running metabase version 49 (open source self-host)

What happens when you export in xlsx or JSON? ... That values seems to be added as a TEXT .. since numbers tend to be left aligned and text to be right aligned

Hey Tony, thank you for the response.

I confirm that the problem is also present in xlsx and json downloads:

As for the numbers being stored as text, i believe you are right which is particularly bizarre considering in our data source (bigquery) this column is formatted as integer (int64)

Any idea how to force metabase into formatting the column as a number and not text ?

Try going to Admin -> Table Metadata and check how those columns are defined there (try to set them as numeric)

Hey Tony, unfortunately I am unable to cast the columns into a numeric

The only options proposed are date/time formats

Oh no not from there but one step backwords ... not CASTING but the Field TYPE

Hey Tony!

My field type is already set as Entity Key alas :confused:
For info: I get the same weird spacing in my exports for all columns that are formatted as numbers (price, quantity, etc) as well as those formatted as keys

But internally at Database level what data type are they in:

Hey Tony,
It would appear that the columns are formatted as integer already

What version of 49 are you running? ... And what happens when you download the formatted vs the non-formatted versions

Hey Tony,
I am on version v0.49.0

I have the same formatting issue regardless of the download format (csv, json, xlsx)


Aha! Can you update to 49.7 ... we made some changes to 49.3 but since you are updating you should update to the latest:

Hey Tony, thanks for your continued support on this ticket :slight_smile:
We have just upgraded to 49.7, but alas the issue persists.
Any other suggestions would be appreciated!

hmmmm you should get those options now:

Tested and this works! :raised_hands:
Thank you so much for the support Tony, you are a star :slight_smile:

1 Like