Hi. How can we help?

Custom measures

The Custom measures tool is what we can use to give more numeric details to data on Analytics reports.

They can be used for simple counts of data, for example:

  • The number of multi-store locations in a grouping
  • The number of customer names associated with a particular email address
  • The number of discounts used in a particular time frame

They can also be used for more complex counting, for example:

  • The number of sales where the sales line employee is not the sale employee
  • The number of instances where an ID field (like vendor ID, UPC, or manufacturer SKU) is empty
  • The number of times when a certain tag occurs in products

Finding custom measure option

The Custom measure option lives in the Custom fields section, to the left of your Analytics data: 

custom_fields.png

To create a new custom measure, follow Custom fields> Add> Custom measure.

A simple custom measure

The most basic usage of custom measures is count distinct, where the number 1 is assigned to each instance of a dimension being measured.

Say you want to count the number of stores that processed sales each day. When you open the custom measure editor, you see this panel:

edit_custom_measure.png

If you click on the Field to measure > Choose field menu, you'll see a list of available dimensions that you can scroll through:

field_to_measure.png

Or, you can start typing the name of the field you're looking for and you'll get options that meet your criteria:

field_to_measure_dropdown.png

Once you select your dimension to measure, you can either select Count distinct, which assigns a 1 to each unique dimension:

completed_date_1.png

Or, select List, which presents the results as a list of all results:

completed_date_2.png

Like custom dimensions, you need to run your report a second time to pull the results onto the table:

run.png

And, like custom dimensions, you should assign a meaningful title to the custom measure:

edit_custom_measure_field.png

A more complicated custom measure

Say you want to find the number of times when the sales line employee was not the same person as the sale employee. You can use a custom measure to count this.

From the custom measure editor, select the Custom filter checkbox:

edit_custom_measure_fields.png

Then you'll see the code editor, which uses Look ML — the same language used in calculations and custom dimensions.

Here is how to build a simple logical calculation:

custom_filter.png

In this instance, search for instances of whether the employee equals the sale line employee, and count the numbers where the answer is No.

sale_completed_date.png

When I save the results, the results seem really low. Why? Because in this example, it was asked to count employees that were not the same as sale line employees.

What to properly ask is to count sales where the employee was not the same as the sale line employee.

So, go back to the editor by selecting the gear icon and Edit.

multiple_employees_filter.png

My code stays the same, but instead, I'm changing the Field to measure from Employee:

field_to_measure_dropdown_2.png

...to Sale ID:

field_to_measure_sale_id.png

Now, save and run:

completed_table_.png

Quick builder

Finally, you can jump-start custom measures from dimensions themselves. 

When you hover over any dimension to the left-hand side of our data, you’ll see three little dots:

multishop_dimensions.png

When you click on the dots, you get the option to aggregate:

aggregate_options.png

Selecting Count distinct or List of unique values launches either of these custom measures into your data.

Was this article helpful?

0 out of 0 found this helpful