Field Data Types
Contents
Overview
A table field has one of the following types:
- text
- datetime
- decimal
- integer
- reference
- choice
- duration
Having the correct type is crucial for many capabilities of Explore Analytics. This is described in greater details in the sections below.
Reviewing and Changing Types
The field type is automatically determined and in most cases requires no adjustment.
Uploading or Import Data
When you upload a data file or import a Google spreadsheet, the data is reviewed and automatically classified into text, datetime, decimal, or integer. The automatic classification is often very accurate, but not always. It is advisable to select the option to "Review and make changes".
The second step in the review shows you the fields and the detected type and allow you to make certain changes.
Reviewing and Changing Field Type After the Table is Defined
Whether the table is in an external data source (database or application) or in the "explore" data source (uploaded or imported), you can review the fields and make changes.
To review the fields, see Listing Table Fields. You'll see a list of fields as shown below.
To make a change, click on a field (e.g., COMMISSION_PCT in the picture above) and select "Edit this field" from the context menu.
In this dialog, you can change the type of the field.
Text
A text field can hold any text. It typically receives no special formatting. Although it's convenient for holding any time of data, it's better to choose the appropriate type if a more specific type fits the data.
datetime
A datetime field is very useful. It can be used in charts to create a timeline and in pivot to aggregate data by period such as year, month, or week. When displaying dates in lists, you can control the date format by setting the default date format in global settings (you can edit the global settings by selecting the "Global settings" option from the "Admin" menu).
Decimal
A decimal field can be used in calculations and display currency (money) values.
Integer
An integer field can be used in calculations and display numbers without a fraction.
Reference
A reference field is crucial for selecting fields from related tables. This type of field is covered in great details in Reference Fields.
Choice
This is a special type of text. A choice field has a limit set of choices and each choice can have a label (a display value). Choice fields are useful in several cases:
- When filtering data. You can select values for a condition from a predefined list of choices
- In pivot and chart categories. You can adjust the label to control the display of the field's value. For example, instead of "t" (true) and "f" (false) you can display "Yes" and "No"
- In pivot columns. You can use choose how to order the values of this field (by the numeric order, value, or label)
You can do all that by selecting "Edit Choices" from the field dialog that you saw before.
When you select edit choices, you'll see the following dialog. (The data shown in the dialog is an example)
Using this dialog, you can edit the labels for the choices and you can control the sorting of the values in pivot.
You can convert any text field to a Choice field, but do that only when it makes sense, when there's a limited list of possible values to choose from.
Duration
A duration field is an integer field that hold the (positive) number of seconds elapsed. When displayed, this field will be formatted to show a value such as "1 day 03:12:00" for one day, three hours, and 12 minutes.