How-to
How to choose and set up the fields of a cube in Hubviz
Choose which columns go into the cube, give them names your team understands and set each field type so measures and charts come out right.
Choose which columns from the source go into the cube, give each one a clear name and say what it is: a date, a value or a category. Measures and charts depend on this setup.
When to use it
- Right after you connect a data source and open the cube for the first time.
- When a chart treats a number as text, or a date as a category.
- When you want to swap technical names (
dt_emissao) for names your team understands (“Issue date”).
Before you start, create the cube from a source, such as an Excel or CSV spreadsheet. The Field Mapping tab only opens after the cube has read the data at least once, or when it already has saved fields.
Choose the fields
When the cube reads the source, each column becomes a field, but none comes checked. Only checked fields go into the cube.
- In the project side menu, open Cubes and click the cube.
- Open the Field Mapping tab.
- Click the Select fields list. It splits the fields into three tabs: Mapped Fields, Calculated Fields and Relationship Fields. The number next to each tab is how many fields it holds.
- Check the fields that go into the analysis, or check Select all fields for the open tab.
- Save the cube with Ctrl + S.
Each checked field becomes a row in the table below the list and a chip inside it. To take a field out of the cube, click the chip’s x or uncheck the field in the list.
In sources with nested data, such as a REST API, child fields show under their parent, with an arrow to open and close. Their friendly name shows the full path, such as customer > name.
Set up each field
The table shows one row per checked field. It has a search box at the top and shows 10 rows per page.
| Column | What it is | Editable |
|---|---|---|
| Field Name | The technical name of the column in the source, lowercase and without accents (receita, lucro_bruto). Formulas use it. | No |
| User Friendly Name | The name shown in measures, charts and filters. It starts out equal to the column name in the source. | Yes |
| Description | A short sentence for whoever uses the cube later. It starts empty. | Yes |
| Field Type | The field’s role in the analysis. See the table below. | Yes |
| Field Value Type | The data format. The options change with the field type. | Yes |
| Actions | Order, hide, primary key, and edit or delete (calculated field). | Yes |
The friendly name and the description are saved when you leave the field (click away or press Tab).
Field types
Hubviz picks a type for each column by looking at the first rows of data. Dates become Date, numbers and currencies become Value, and text and true/false become Category. Check them and fix what is off.
| Type | What it is for | Value formats |
|---|---|---|
| Id | The unique identifier of each record. Only one field in the cube can be Id. | Text or Number |
| Date | Dates and times, such as issue, due or creation. Measures use a date to spread the value over time. | Date |
| Value | Numbers you sum, average or compare, such as revenue or quantity. | Text, Currency, Number, Decimal or Time |
| Category | Text with options that repeat, such as business unit, status or salesperson. Used to group and filter. | Text, Number, Single Choice or Boolean |
| Items | Lists of values inside a record, such as the tags of an order. | List, Single Choice, Multiple Choice or Currency |
| Object | Complex objects, such as a multi-level JSON. Usually the parent of child fields. | Single Choice |
| Relationships | Fields that come from another cube through a relationship. You don’t create this type by hand. | Text |
When you change the field type, the value format switches to the first allowed format, unless the current one is also allowed. When you change a field to Value and its name starts with hora, duracao, tempo or minuto (Portuguese for hour, duration, time, minute), the format chosen is Time.
Row actions
The buttons in the Actions column change with the field.
| Button | What it does |
|---|---|
| Up and down arrows | Change the field’s position. The order applies to the table, the chips and the cube’s field lists. The arrow is disabled on the first and last field. |
| Hide Field / Show Field | Hides the field from the project diagram and from the data table columns, without taking it out of the cube. Only on mapped fields. |
| Set as Primary Key / Remove Primary Key | Marks the field as the primary key. Only on mapped fields. |
| Edit Calculated Field | Opens the calculated field. Only on calculated fields. |
| Delete Calculated Field | Deletes the calculated field. Only on calculated fields. |
Primary key
The primary key is the field that identifies each record. When you mark a field as the primary key, its type becomes Id and it stops being hidden. When you remove it, the type goes back to Value.
- Only one field can be the primary key. If another one exists, Hubviz opens the Change Primary Key window and asks you to confirm.
- The primary key’s type and visibility are locked. To change them, remove the primary key first.
When the cube has no date
If no field is of the date type, Hubviz shows a notice at the top of the tab with the Add date field button. It creates a calculated field called “Date”, with the formula NOW(), which holds the date and time at the moment the cube is processed. Use it when the data has no date of its own, because measures need a date field. To dismiss the notice, click the x.
Example: Aurora’s Sales cube
The Sales cube came from a CSV with the columns data, unidade, receita, custo and meta. After reading the file, the mapping looks like this:
| Field | Friendly name | Field type | Value type |
|---|---|---|---|
data | Date | Date | Date |
unidade | Business unit | Category | Text |
receita | Revenue | Value | Number |
custo | Cost | Value | Number |
meta | Target | Value | Number |
Check the five fields, switch the format of receita, custo and meta to Currency if you want to see money values, and save. The next step is to create the calculated field lucro_bruto with calculated fields.
Messages and limits
| Message | Cause and fix |
|---|---|
| The selected field type is not compatible with the associated data. | Hubviz looked at the data it read and it doesn’t fit the type. Value needs numbers, Date needs dates and Items needs lists. Pick another type or fix the column at the source. |
| Only one field can have the type ‘Id’. | There is already an Id field. Change the other field’s type first. |
| Primary key type cannot be changed. | Remove the primary key to change the type. |
| Primary key field cannot be hidden. | Remove the primary key to hide the field. |
| The cube has more than one field with the same name | Two columns became the same technical name. Rename one of them at the source. In databases, use aliases (AS) in the SQL query. |
| Cube not saved. Please save the cube first to create a measure. | Save the cube before opening the measures tab. |
- The Field Mapping tab stays disabled while the cube hasn’t read the source and has no saved fields.
- If you read the source again and a column is gone, its field leaves the cube. Calculated and relationship fields stay.
- If a column in the file changes its name, Hubviz treats it as a new field. Check the new one and redo the measures that used the old one.
Next steps
- Create new columns from existing ones with calculated fields.
- Link this cube to another with relationships.
- Compute the dashboard numbers with measures.