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.

| What | Where you read it | Where you change it |
|---|---|---|
| Source fields | Schema tab of the cube | Dimensions and Measures tabs of the Charge job |
| Grain | Side panel of the cube | Grain 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 state | Rule |
|---|---|
| Draft | All Charge jobs of the cube must define the same grain. Hypermeter rejects a change that makes one job differ. |
| Published | The grain is locked. See When the locked grain is wrong. |
To change the grain of a Draft cube with several Charge jobs:
- 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.
- Change the grain in each job.
- 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.