Skip to main content

Source fields and grain

Source fields are the columns that Charge jobs deliver to a cube. The grain says what one row means. A cube takes both from its Charge jobs: you read them on the cube page and change them in the Charge job.

The Schema tab of a cube. The grain is in the panel on the right.
The Schema tab of a cube. The grain is in the panel on the right.
WhatWhere you read itWhere you change it
Source fieldsSchema tab of the cubeDimensions and Measures tabs of the Charge job
GrainSide panel of the cubeGrain tab of the Charge job

For the Charge job editor, see Chargers.

Source fields​

Each dimension and each measure of a Charge job becomes a source field with a stable key. When several Charge jobs feed one cube, Hypermeter combines their source fields and checks that they fit together. See Producer compatibility.

People do not select source fields in a view. They select reporting fields, which you add on top.

Grain​

The grain has two parts:

  • A time grain: hour, day, week, month, quarter, or year.
  • Zero or more identity dimensions, which make rows unique within each period.

A monthly Charge job with customer_id and subscription_id gives one row per customer, subscription, and month. A grain without identity dimensions is valid when each period holds at most one row, such as one daily total.

You cannot publish a cube without a grain.

Change the grain​

Cube stateRule
DraftAll Charge jobs of the cube must define the same grain. Hypermeter rejects a change that makes one job differ.
PublishedThe grain is locked. See When the locked grain is wrong.

To change the grain of a Draft cube with several Charge jobs:

  1. In each Charge job, open the Configuration tab and select Keep as intermediate under Cube publication (optional). The job no longer writes to the cube.
  2. Change the grain in each job.
  3. In each job, choose the cube again under Cube publication (optional).

This works only for a Charge job that has not yet run in the published workflow. After that run, the cube of the job is fixed.

Do not change a grain back to an earlier value to start clean. The Charge job then refuses every run. See A Charge refused after the grain changed back.