Skip to main content

Logical cubes

A logical cube, or cube, is the named reporting contract for one fact, such as "Cloud Cost". It fixes which fields exist, which type they have, and what one row means. Workflows must deliver data that fits the contract, and views read only the contract, so either side can change without breaking the other.

This page explains the rules of that contract. To build a cube, start with Creating a cube.

Two sides of one contract​

SideIts questionWhat it works with
Producers: the Charge jobs that feed the cubeDoes this data fit the contract?Source fields and grain
Reports: the views built on the cubeWhat can I measure and group by?Reporting fields

Every view is built on exactly one cube, and never sees the workflow behind it.

The rules that matter​

A field is identified by its key, not by its label​

Each source field has a key, a label, a type (string, number, boolean, date, or timestamp), a kind (dimension or measure), and a description. References use the key. You can change the label cost_usd to "Cost (USD)", and every Charge job and reporting field that uses the field keeps working.

The grain is locked when you publish​

The grain is what one row means: a time granularity (hour, day, week, month, quarter, or year) plus the identity dimensions that make a row unique.

A cube starts as a Draft, and nobody can build a view on a Draft. While the cube is a Draft, you change the grain in the Charge jobs that feed it. When you publish the workflow, the cube is published too and its grain is locked. That lock is what lets reports rely on the meaning of a row.

Choose your grain carefully

You cannot edit a locked grain. If it turns out wrong, you create a replacement cube. See Source fields and grain and Publishing and evolving.

Publishing checks the contract, not the data​

A cube can be published when a Charge job is connected, the grain is set, and every producer fits the contract: it maps every grain field and uses compatible field kinds and types.

Publishing does not validate data

The check does not look at whether your numbers are right. It also does not need a completed run, so you can publish before the workflow has run.

After publishing, you can still add​

  • Add fields that are not part of the grain.
  • Feed the cube from more Charge jobs.
  • Add reporting fields: measures and dimensions.
  • Change labels and descriptions.
  • Grant the cube to more spaces.

None of these changes can break an existing view.

Several Charge jobs can feed one cube​

You never link a workflow to a cube by hand. When a Charge job names a cube, its workflow becomes a producer of that cube.

How producer data is added and replaced

The results of different Charge jobs add together in the cube. A new run of the same Charge job replaces the data of that job for the dates it covers. See Linking producers.

Report builders use reporting fields​

Reporting fields are the named measures and dimensions that people pick in a view. You define them on top of the source fields, so report builders never work with raw columns. See The semantic model and Reporting fields.

Each space sees its own part of the cube​

A space sees only the fields it is allowed to see. The same cube can therefore show different fields to an owner and to a member of one space. See Roles and access and Field scopes and promotion.

Example​

A "Cloud Cost" cube has a monthly grain with the identity dimensions customer and subscription: one row per customer, per subscription, per month.

  • Two workflows feed the cube, one per cloud provider. Each has its own Charge job, and their results add together.
  • The source field cost_usd is offered to report builders as the measure "Total Cost".
  • Later you replace the Extract job of one workflow. The cube keeps its fields and grain, so every view keeps working.