Many businesses want to determine the ratio between two events:
- A measure assigns a value to a set, which is interpreted as its size.
- A ratio is the relationship between two measures, indicating how many times the first measure contains the second.
How to determine the ratio between two measures
This section demonstrates how to create a query that determines a ratio between two measures. In our example, we want to determine the number of unique users who watched movies over the last 200 days, and the ratio of movies watched to the number of unique users.
Determining a ratio between two measures involves three steps:
- Define the first measure.
- Define the second measure.
- Define a third measure that is the ratio of the first two measures.
To create a query that determines a ratio between two measures, do the following:
- Click Explore.
- To define the first measure, select the appropriate variables from the dropdown lists. We did the following:
- Accept the default count aggregation.
- Click events and select username from the dropdown. The text auto updates to Count unique username actors and filtered to all username actors.
- Click measure 1 and enter a unique name for the measure. We entered All users.
- Click +measure to begin defining measure 2.
- For measure 2, select the options from the dropdown lists. We chose to show count unique values of an actor property defined previously, Movies watched over the last 200 days. We accepted the filter, Filtered to all user actors.
- Click measure 2 and enter a name. We named the measure Movies watched.
- Click +measure to begin defining measure 3. This measure will be the ratio of the first two measures.
- In measure 3, click Count, then type an equals sign. Optionally click the arrow to open the Advanced Operations workspace.
- Type a left bracket [. A dropdown appears containing the first two measures.
- Select the numerator from the dropdown list
- Type a slash.
- Type a left bracket and select the denominator. Click outside the dropdown to accept the expression.
- Accept, or change, the split by, Starting and Ending values.
- Click GO. We received the following results for our example.
See Calculate measures and filters for information about building expressions.
Now that you've created a query to determine a ratio, you can move on to analyzing user sessions with flows.