Data Sources and Tables
Overview
Data for analysis is organized in tables grouped under data sources. See Preparing to Explore for more information about configuring data sources and uploading data.
The menu option Explore -> Data Sources and Tables displays a list of your data sources. Click on a data source name to get a list of tables for that data source. From there you can click on a table name to bring up a view on that table. This would be an existing view or a new view if no view exists for this table. You can also use the context menu to create a new view or to list the fields of this table.
Editing Table Fields
The following attributes of a field are automatically set, however depending on your role and permission, you may be able to edit them. When editing fields, you are editing the field definition for all users who may access this table. Therefore, the changes you make will affect all these users.
- name - the name of the field in the database. When you upload a CSV File, this is the field name from the file. The name cannot be edited
- label - the display name of this field. This is the name shown when selecting fields and it is the title shown for fields in views. You can edit the label to shorten it or to make it more descriptive. You can also use the label to translate the name to your language.
- type - the type of this field: datetime, decimal, integer, text, or reference. When you change the type, you are not changing the data, but only the way that Explore Analytics interprets the data in this field. You choice of types will be restricted. For example, you may interpret a number as text, but not as a date.
Reference Fields
Reference Fields are automatically defined when you add a data source that is a database such as Oracle or MySQL and the database has these references already defined (they are called Referential Integrity Constraints). In that case, Explore Analytics will automatically defined fields that have a (single field) referential constraint as reference field.
A reference field has values that uniquely identify rows in another table by matching a field in that table. These are called the Target Table and Target Field respectively. You can manually define reference field.
Manually Defining a Reference Field
Let's do this by an example. Suppose we have an "employee" table with a "department_id" field that has the employee's department ID, and a "department" table with a "department_id" field that uniquely identifies a department.
Both tables must be in the same data source.
- using the menu, click Explore -> Data Sources and Tables and then click on the data source that includes the employee table
- right-click or touch on any cell in the row of the "employee" table to open the context menu
- from the context menu, click "Fields"
- in the fields list for table employee, open the context menu for the "department_id" field
- from the context menu, click "Edit..."
- change the Type to reference
- set the target table to "department"
- set the target field to "department_id"
- click OK
The next time you select fields from the employee table you'll be able to also select fields from the department table.