KNOWLEDGE BASE

Number Types Are Recognized as String When Importing Files(Excel, CSV, etc) To Tableau


Published: 21 Jun 2022
Last Modified Date: 13 Mar 2023

Issue

When importing file-based data to Tableau, the fields are recognized as [Demision - String] even though these fields only contain numbers and NULL.

For example, in the below data, [Number2] and [Number3] only has numbers but are recognized as STRING in Tableau. 
User-added image

 

Environment

  • Tableau Desktop
  • Tableau Server
  • Tableau Cloud

Resolution

Option 1
After importing data from files to Tableau, hold the Shift key, select multiple fields, and change them from strings to "continuous measure" decimals in a batch.

Option 2
Move the rows with numbers to the first rows, then load the data into Tableau.
Please check the image below. 
User-added image
 

Cause

This is by design.
Tableau determines how to map mixed-value columns to data types by the data types of the first 10,000 rows in an Excel data source, and the first 1,024 rows in a CSV data source. 
If the first 10,000 rows in an Excel data are NULL, Tableau will determine this field as STRING even if it has number values after 10000 rows.
Data Types -- Mixed data types in data from files

 
Did this article resolve the issue?