Docs
Measures

Measures

Measures are measurements that can go up and down over time. Each measure should map to a measurement of a process or workflow in your organization. Counts of events, revenues and cycle times are good examples of measures you may want to add to your data model.

You can setup and update measures from the Add Data Model workflow.

Types of measures

NameInput Column TypeDescription
row countNo input column requiredCount of rows.
custom measureNo input column requiredA SQL-based custom aggregation. See Custom SQL Measures for more details.
countString or NumericSQL COUNT(). Counts the number of non-null values in a column.
count distinctString or NumericSQL COUNT(DISTINCT). Counts the number of unique, non-null values in a column.
minNumericSQL MIN(). Finds the minimum value of a column.
maxNumericSQL MAX(). Finds the maximum value of a column.
avgNumericSQL AVG(). Finds the arithmetic mean of a column.

The row count measure

The row count measure is added by default to a data model and can't be removed. This is intentional - see the best practices for defining this measure in the Data Modeling Best Practices.

Column aggregations

The simplest type of measure. See table above for which functions you can run on specific measures.

To add a column aggregating measure:

  1. Go to the Add Data Model workflow by creating a new data model or editing an existing model.
  2. In the list of fields, click Add measure next to the name of the field you'd like to aggregate.
  3. Click on the new item in the measure list to expand the and select the aggregation type.

Custom SQL measures

Custom SQL measures allow you to have more involved custom aggregations in Hashboard like weighted averages or proportions and other formulas. You can define a custom measure as any aggregating function (opens in a new tab) that results in a numeric value.

To add a custom measure:

  1. Go to the Add Data Model workflow by creating a new data model or editing an existing model.
  2. Under the Measures section click the + Add Custom Measure button.
  3. Enter your aggregation and click the 🔄 button to test the SQL.

Referencing other measures or attributes

Custom measures can refer to other measures or attributes to avoid duplicating logic. For instance, a Profit measure could be defined by deducting the Costs measure from the Revenue measure.

SQL for Profit measure
{{ revenue }} - {{ cost }}

SQL can reference other measures or attributes by surrounding their alias in double curly braces. When querying, Hashboard will expand references to their full definitions.

Using joined columns in custom SQL

See Using Joined Columns in Custom SQL for more info.

Measure folders

You can organize your measures and attributes into folders to keep your data model tidy and easy to navigate.

To organize your measures into folders in a data model:

  1. Open the data model in the Model builder.
  2. Select the measure you want to move to a folder.
  3. In the measure configuration pane, locate the Folder input field.
  4. To move a measure into an existing folder, select the folder in the dropdown. To create a new folder, type the desired name into the search input and click the option to Add a new folder with that name.
  5. Repeat steps 2-4 for each measure you want to organize into a folder.
  6. Once you’re finished, save the data model.
  7. Start exploring the data model, and you’ll see your folders in the Data tray.