Look Ahead

One of the challenges in analytics is to understand what kind of behaviour leads user to take a specific action, for example to churn. To analyze these types of questions, you can investigate reasons behind user behavior by using a future state of the user and run historical data against the future state of the user. This is called Look Ahead.

Analysis and Interpretation

The Look Ahead tables take a user state of each user on a specified date.


Let's define user churn as 10 days of inactive (this is adjustable). In the screenshot below, the dates shown in the charts are the last active dates. Using the churn criteria (10 days of inactivity), the data will not have the last 10 days as users were not active.

As mentioned, all these states are from the perspective of user states available on the 2016-01-31, which are then reflected on the user actions of previous days. An example of results can be found below.

Creating Look Ahead Charts and Tables

To create custom versions of the Look Ahead analysis, the following are needed:

  1. Look Ahead specific fields
  2. Look Ahead table

We have an example package that can be added to the project. To install, please navigate to Data > Packages > Look Ahead Template

Creating Look Ahead fields

Look Ahead fields can be easiest created by cloning an existing User Field.

For example User Retained Days
user_state['daynum'] - user_state['first_daynum']

and modifying it to the following:
look_ahead_user_state.daynum - look_ahead_user_state.first_daynum

Another example could be Users Last Level
look_ahead_user_state.last_event_time == event_meta['timestamp'] and (user_vars['cuf_user_level'] or 0) or 0

In fact these jobs can be run against any user state by creating an approriate event field.

Creating Look Ahead table

The next step is to create a Look Ahead table. This table created in a similar fashion to an Event-based Table using the look ahead fields. When creating the table you need to select under the Advanced options the date that is to be used as the reference point for the table. In other words, which user states are used as the look ahead values when processing historical data.

For example, you would like to know the number of churned user during the month of January. You have defined churn as user inactive for consecutive 10 days. Select to create a Look Ahead Table, and open 'Advanced' settings (see the screenshot below). In this case we select the last date of January as the Look Ahead Date and add the churn definition to the Look Ahead Conditions, i.e. (evLib.userDaysActiveLast(10) == 0). Make sure to have a long enough date range to have user eligible for user state criteria used. In this case we need to have more than 10 days of data to have users that have been inactive for 10 days. Is the criteria is not met, the job will fail. Also make sure that Look Ahead date matches the end date of the date range.

Then you can build your Look Ahead table as any other table while using the newly created Look Ahead Fields.

We recommend exploring the associated package for more details and ideas for analysis.

NOTE: The look ahead tables are not updating daily. To have updated data in the charts, you need to run a new job with updated date (which also means updated user states).

This article was last updated on February 23, 2016 18:34. If you didn't find your answer here, search for another article or contact our support to get in touch.