Event Number Calculated Column
This topic outlines the purpose and uses of the Event Number calculated column available in the Manage Data > Data Warehouse page. Below is an explanation of what it does, followed by an example, and the mechanics of creating it.
Explanation
The Event Number column type identifies the sequence in which events occurred for a particular event owner, like a customer or user. If you are familiar with SQL, this column type is identical to the RANK function. It could be used to observe differences in behavior between first-time events, repeat events, or nth events in your data.
In cases of a tie, this column contains the same rank for the tied events, and skips the subsequent numbers. For example, if it were ranking the numbers 5,8,10,10,12, the ranks would be 1,2,3,3,5.
The most common use case of this column is to analyze first time buyers and repeat buyers. First time buyers are identified by adding a filter (to a metric or report) on Customer's order number = 1. Customer's order number is a column of the type Event Number.
Example
event_idowner_idtimestampOwner's event numberIn the above example, the column Owner's event number is an Event Number column. It ranks the owner’s events in the order in which they occurred (based on the timestamp column).
For instance, consider all rows where owner_id = A. The first row in the table is the earliest timestamp for this owner, followed by the third row in the table, followed by the fourth row in the table.
Mechanics
Here are some instructions on creating an Event Number column:
-
Navigate to the Manage Data > Data Warehouse page.
-
Navigate to the table on which you want to create this column.
-
Click Create a Column and choose the
EVENT_NUMBER (…)column type: under theSame Tablesection. -
The first dropdown
Event Ownerspecifies the entity for which the rank is to be determined. In the case where aCustomer's order number, a customer identifier such ascustomer_idorcustomer_emailwould be theEvent Owner. -
The second dropdown
Event Rankspecifies the column that enforces the sequence that determines the rank of the row. In the case where aCustomer's order number, thecreated_attimestamp would be theEvent Rank. -
Under the
Optionsdropdown, you can add filters to exclude rows from being considered. The excluded rows have aNULLvalue for this column. -
Provide a name to the column and Click Save.
-
The column is available to use immediately.