Queries and Measures

Introduction

Query is a Formula used to get Measures from user events using mathematical functions. Functions such as Count or Aggregation (MIN/MAX/SUM/AVG) can be used to compute simple measures, which can then be compounded using the + and / operators for more complex analysis.

Measure

Measure includes one Function (e.g. "Count Events") applied to at least one set of Events each can have its own Event Filters.

  • Name: you can provide a name for each Measure so they can be easily identified on the result analysis chart. If the name is not specified, a default name such as "M1", "M2" will be used.
  • Format: you can decide how to format the Measure in the chart by selecting between #, % and $, and also specify the number of digits to keep.
  • Saved Measure: you can save a measure when it is completely defined. All Saved Measures will be available in the Measure dropdown list for others to reuse.

Create and Save a Measure

Often the same Measure would be used over and over for the calculation of different business metrics. Measures can be saved in order to promote re-use and consistency across queries.

15181518

Re-use a Measure

Sometimes Measures would be complicated as they would be based on multiple events and filters and that makes it really hard for everyone across multiple teams to remember all the details to compute the Measure correctly. Luckily, it only has to be defined once and can then be re-used by everyone. All you need to know to re-use a measure is its name.

15181518

Use Functions

Functions are applied over Events in order to produce insights. Each Function can be applied to multiple groups of Event(s) and each group may have different filters. The following are supported out of the box:

  • Count Events: count number of events
  • Unique Users: count unique users with distinct User Id
  • Unique Values: count unique number of values for a certain Event Property
  • Min/Max/Sum/Average: aggregation functions on a certain Event Property

Apply Filters

Filter is the constraint applied during analysis. There are two kinds of filters:

  1. Event filter - filters applied to the events
  2. Global filter - filters applied to the formula globally
12041204

Each filter contains three parts:

  1. Field: a field of the data model. For example: App Version, Device Name, OS, Language.
    • Each field has a data type of: string, number, boolean, JSON or BigQuery Struct.
    • JSON or BigQuery Struct field can expose their internal data for filter or breakdown through Nested Property.
  2. Operator:
    • Exist operators: exists TRUE or FALSE
    • String operators: =, !=, starts with, ends with, contains etc. Note: = and != can have multiple values.
    • Math operators: =, !=, >, >=, <, <=, between. Applicable to numeric and date data type
  3. Value(s): depends on the Field data type and selected Operator, there can be multiple values to be selected from a list of lookup values, or manually entered.

Filter Groups

Both Event Filter and Global Filter support up to three Filter Groups which are connected with a logic operator AND/OR. You can think of each Filter Group as a parenthesis.

11961196

Within the Filter Group you can specify up to three filters and connect them with AND/OR operators. Note: the evaluation order of filters within a certain Filter Group is decided by the natural order of logical operators, i.e. A or B and C = A or ( B and C ).

Group results

"Group by" is a technical term for slice-and-dice, which means split the data into groups. You can use Breakdown to group your data.

Breakdown

When using Breakdown you tell Kubit to split the events into groups based on a certain field's values. Any event with the same field value are grouped into the same slice/group then measured. Click here to learn more about how to use breakdown.

23482348