知識庫

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


發佈時間 : 21 Jun 2022
上次修改日期 : 13 Mar 2023

問題

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

 

環境

  • Tableau Desktop
  • Tableau Server
  • Tableau Cloud

解決方法

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
 

原因

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

 
這篇文章是否解決了問題?