Defining the Grain of a Data Source

After creating hierarchies, you are ready to define the grain of your data sources. The grain of a data source defines precisely what a data record in the source represents. It specifies the level of detail captured in a source. In Birst, you declare the grain as a combination of hierarchy levels.

In a good data model, the combination of all the level keys on a grain must result in a unique key. When Birst does fact-to-fact joins or looks up information from higher level facts, Infor uses the grain key which is all the columns from all of the level keys. If the grain key is not unique, it could result in a Cartesian join and essentially lock the database.

Birst checks these two conditions when picking the grain of a fact:

If the source table drives columns in a given dimension, then put that dimension in the grain.

The combination of all level keys in the grain must result in a unique key.

Birst checks to make sure the grain key for each source (that is, the combination of the level keys for each level in its grain) is unique. If the grain of a source is not unique, Birst will still load the data but will capture the event as an error in the load log.

You only need to define the grain of your data sources for Advanced spaces.

See Case Study: Creating Grains and Hierarchies for an example of how to use hierarchies and grains in Birst.

To define the grain of a data source

1. In the Admin module, click Define Sources -> Manage Sources.
2. In the Manage Sources tab, select a data source from the list.
3. Click the Grain tab.
4. To add a hierarchy level to a source's grain definition, check its box.

Important: If the required hierarchy level does not exist, you need to add it on the Hierarchies page.

5. Repeat adding hierarchy levels until the grain of the source is fully defined.

Tip: Birst automatically adds an implicit level from the time dimension to the grain definition of a source that contains measurements.
6. Click Save.

Once the hierarchies are set up and sources are assigned to the appropriate grains, then individual columns can be targeted to hierarchies or levels and targeted as measures. See Defining Column Properties.

See Also
Creating a Data Model
Setting the Primary Key
Creating Hierarchies
Defining Column Properties
Case Study: Creating Grains and Hierarchies