Strategy One

Fact Metrics Array

The factMetrics array defines the quantitative measures in the model (for example, Total Dollar Sales, Total Cost). These are usually simple aggregations over table columns.

Fact Metric Properties

Field Type Description Example

information

Object

Core identity of fact metric. Contains primaryLocale (the locale of the user who created the object), objectId (the unique 32-character hex identifier for the object), subType (fact_metric), name, and description.

{ name: "Total Dollar Sales" }

fact

Object

Maps the metric to physical table columns with data type.

{ dataType: { type: "double" } }

function

String

Aggregation function such as sum, avg, and count.

"sum"
format

Object

Visual formatting rules for numeric values.

{ values: [{ type: "number_format", value: "#,##0" }] }

acl Object Access Control List for the metric. For more information, see Access Control List. { "USER_ID": { granted: 255 } }

translations

Object

Localized name and description. For more information, see Translations.

{ name: { translationValues: {...} } }

Example

See the following fact metrics file example:

Copy
factMetrics:
- information:
    name: "Total Dollar Sales"
    description: "Total dollar sales amount"
  fact:
    dataType:
      type: "double"
      precision: 1000
    expressions:
    - expression:
        text: "tot_dollar_sales"
      tables:
      - name: "day_ctr_sls"
  function: "sum"
  format:
    values:
    - type: "number_category"
      value: "1"
    - type: "number_format"
      value: "#,##0"