Difference between revisions of "Field Data Types"

From Explore Analytics: The Wiki
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 13: Line 13:
 
Having the correct type is crucial for many capabilities of Explore Analytics.
 
Having the correct type is crucial for many capabilities of Explore Analytics.
  
==Reviewing and Changing Types==
+
==Reviewing and Changing the Type==
  
 
The field type is automatically determined and in most cases requires no adjustment.
 
The field type is automatically determined and in most cases requires no adjustment.
  
===Uploading or Import Data===
+
===Uploading or Importing 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".
+
When you upload a data file or import a Google spreadsheet, the data type is automatically classified into text, datetime, decimal, or integer. The automatic classification is often accurate, but not always. It is advisable to select the option to "Review and make changes".
  
 
[[File:upload_fields_review.png]]
 
[[File:upload_fields_review.png]]
  
The second step in the review shows you the fields and the detected type and allow you to make certain changes.
+
There are two steps for the review. The first has to do with the delimiter. The second step in the review will show you the fields and their detected type and allow you to make changes.
  
 
[[File:upload_fields.png]]
 
[[File:upload_fields.png]]
Line 43: Line 43:
 
==Text==
 
==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.
+
A text field can hold any text. It typically receives no special formatting. Although it's useful for storing any type of data, it's better to choose the appropriate type if a more specific type fits the data.
  
 
==datetime==
 
==datetime==
Line 63: Line 63:
 
==Choice==
 
==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:
+
This is a special type of text. A choice field has a limited 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
+
* '''When filtering data'''. A condition value can be selected 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 and chart categories'''. The label can be adjusted to control the display of the field's value. For example, instead of "y" and "n" 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)
+
* '''In pivot columns'''. You can use choose how to order the categories defined by 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.
 
You can do all that by selecting "Edit Choices" from the field dialog that you saw before.
Line 79: Line 79:
 
Using this dialog, you can edit the labels for the choices and you can control the sorting of the values in pivot.
 
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.
+
You can convert any text field to a Choice field when there's a limited list of possible values to choose from.
  
 
==Duration==
 
==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.
+
A duration field is an integer field that holds 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. It will sort correctly and can be used in calculations.
  
  
{{Template:TOC|Data Sources and Tables|Drill Down}}
+
{{Template:TOC|Data Sources and Tables|SQL Expression Field}}

Latest revision as of 08:52, 3 March 2016

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.

Reviewing and Changing the Type

The field type is automatically determined and in most cases requires no adjustment.

Uploading or Importing Data

When you upload a data file or import a Google spreadsheet, the data type is automatically classified into text, datetime, decimal, or integer. The automatic classification is often accurate, but not always. It is advisable to select the option to "Review and make changes".

Upload fields review.png

There are two steps for the review. The first has to do with the delimiter. The second step in the review will show you the fields and their detected type and allow you to make changes.

Upload fields.png

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.

List of fields.png

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.

Edit field.png

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 useful for storing any type 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 limited set of choices and each choice can have a label (a display value). Choice fields are useful in several cases:

  • When filtering data. A condition value can be selected from a predefined list of choices
  • In pivot and chart categories. The label can be adjusted to control the display of the field's value. For example, instead of "y" and "n" you can display "Yes" and "No"
  • In pivot columns. You can use choose how to order the categories defined by 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.

Edit choices.png

When you select edit choices, you'll see the following dialog. (The data shown in the dialog is an example)

Edit choices dialog.png

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 when there's a limited list of possible values to choose from.

Duration

A duration field is an integer field that holds 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. It will sort correctly and can be used in calculations.