BASE DE CONNAISSANCES

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


Date de publication : 21 Jun 2022
Date de dernière modification : 13 Mar 2023

Problème

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

 

Environnement

  • Tableau Desktop
  • Tableau Server
  • Tableau Cloud

Résolution

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

 
Cet article vous a-t-il permis de résoudre le problème ?