Measuring events in Scuba 2.x and 3.x are similar. In both releases:
- Scuba includes default measures—in version 2.x and 3.x—that you can use with queries. You can measure almost any count or aggregation over a data column, such as an average or median.
- An event is an action taken by an actor, such as a user or sensor. An event can be anything: a web conversion, an online purchase, a click on a web page, a step tracked on a wearable device, playing a song, a sensor reading, swipes on a mobile app, or an email click. Each event becomes a row of data. Each event can have many different attributes, but will always have a timestamp and an actor.
However, the terminology and the location of the options for constructing queries in the user interface (UI) are slightly different in 2.x and 3.x.
This article demonstrates how to perform the following tasks:
Creating a 2.x query that measures events
In 2.x, use the Interactive Query Builder to specify a top-level aggregation function with the Measure controls. Time and Table views support multiple simultaneous measures in the results.
To create a 2.x query measuring events, do the following:
- Open Explorer, then select a Dataset and View. In our example, we chose the movies dataset and Time view.
- Specify a Start and End time. Or, highlight the data range in the time scrubber like we did in our example.
- In the Measure field, select Count of Events.
- Optional: In the Compare field, select desired Groups. In our example, we selected device_type.
- Optional: Select Chart Controls, then deselect the Sampled Query radio button and click Apply. This will return unsampled query results.
- Click GO. We received the following results for our example.
Creating a 3.x query that shows the count of events
In 3.x, the Show options in each measure provide similar options and results as those we used to measure events in the previous 2.x example.
To create a 3.x Show count of events query, do the following:
- In the Explore window, accept Show count of events and Filtered to all events (defaults) for measure 1.
- Click inside the measure 1 text and enter a name for the measure. We entered Count of events for our example.
- Optional: Select a Split by option, then specify Limit and Ordered by options. We chose to Split by device_type for our example, accepted the default Limit of 25, and Ordered by Count of events descending.
- Specify a Starting and Ending time range for the query. Or, select the data range in the time scrubber at the bottom of the page.
- Optional: Toggle Sampled to All, as we did in our example. This returns unsampled query results.
- Click GO. We received the following results for our example in the default Time View.
- Optional: To display the results in a different format, click the appropriate View icon at the top of the window. We chose to view our results in Sunburst format.