Data Types

All fields in a data source have a data type. The data type reflects the kind of information stored in that field, for example integers (410), dates (1/23/2005) and strings (“Wisconsin”). The data type of a field is identified in the Data window by one of the icons shown below.
Icon Description
Text values
Date values
Date & Time values
Numerical values
Boolean values (relational only)
Geographic values (used with maps)

Sometimes Tableau may identify a field with a data type that is incorrect. For example, a field that contains dates may be identified as an integer rather than a date. To change the data type in Tableau, right-click the field in the Data window, select Change Data Type, and then select the appropriate data type.

Sometimes the data in your database is more precise then Tableau can model. When you add these values to the view a precision warning will appear in the right corner of the status bar. See Precision Warnings.

Mixed Data Types for Excel, Access, and CSV Files

Most columns in an Excel, Access, or CSV (comma separated value) file contain values of the same data type (booleans, dates, numbers, and text). When you connect to the file, Tableau creates a field in the appropriate area of the Data window for each column. Dates and text values are dimensions, and numbers are measures.
However, a column might have a mixture of data types such as numbers and text, or numbers and dates. When you connect to the file, the mixed-value column is mapped to a field with a single data type in Tableau. Therefore, a column that contains numbers and dates might be mapped as a measure or it might be mapped as a date dimension. The mapping is determined by the data types of the first 10,000 rows of an Excel data source, and the first 1,024 rows of a text file data source (first 16 rows if you're using a workbook that was created before Tableau Desktop 8.2 or the legacy connection). For example, if most of the first 10,000 rows are text values, the entire column is mapped as text.
Note: Empty cells also create mixed-value columns because their formatting is different from text, dates, or numbers.
Depending on the data type that Tableau determines for each field, the field might contain Null values for the other (non matching) records as described in the table below.
Mapped data type Treatment of other data types in the field.
Text Dates and numbers are treated as text. Nulls are not created.
Dates Text is treated as Null. A number is treated as the day in numeric order from 1/1/1900.
Numbers Text is treated as Null. A date is treated as the number of days since 1/1/1900.
Boolean Text, dates, and numbers are treated as Null.
If using fields that are based on mixed-value columns introduces difficulties when analyzing your data, you can:
  • Format empty cells in your underlying data source so they match the data type of the column.
  • Create a new column that does not contain the mixed values.

No comments:

Post a Comment