1 Reply Latest reply on Oct 3, 2012 6:15 PM by Jonathan Drummey

    Creating cohorts based on the date of a user's final action

    Mike Greening

      We're tracking user events in an online game.  I've set up a view in a sample data set with individual user IDs on the x axis and the time of their final tracked event ever on the y axis (MAX(lastEventTime)), over a span of 7 days from September 12, 2012 to September 18, 2012 (see the attached image).

       

      I would like to create a cohort of the users whose final event occurred on a specific day during that date range.  For example, I want a cohort of all users whose final event ever occurred on September 15, 2012.  I could add a date filter to show only that day and create a set for those users that I can use in other views.

       

      However, my problem is that each user session creates a lastEventTime data point for the last action the user took in that session.  So, when I filter to only show September 15, Tableau throws in all users that had a session on that day and shows their MAX(lastEventTime) for their final session of that day.  Many of those users went on to play on the 16th, 17th, and 18th, but some of them didn't, and I want to isolate them.

       

      Any ideas?  It's easy enough for me to just show the MAX(lastEventTime) for all dates and all users and then create a set by highlighting all users on the day that I want, but that's going to get unruly in a hurry when we have thousands of users over months of time.  Another way to tackle this might be to have our database guy set up a new event type called "finalEvent", which is overwritten each time a user logs out and is distinct from the session-based lastEventTime.

        • 1. Re: Creating cohorts based on the date of a user's final action
          Jonathan Drummey

          Hi Mike,

           

          When you say "final event ever," do you mean final event within the date range you are filtering for, or the date range across the entire data set?

           

          In the former case, there are a couple of options I can think of, I set them up in the attached using the Superstore Sales data, using Customer and Order Date in place of userID and lastEventTime. Option 1 filters on the Order Date, and has a second filter based on MAX(Order Date) that is set to show only relevant values. It would be ideal, I think, if the second filter were able to select for individual days, but Tableau does not give us that option for continuous date filters (and the MAX(Order Date) field needs to be set as continuous for Tableau to allow it to be a filter, since Tableau only allows continuous aggregated values to be used for filters).

           

          Option 2 uses the same filter on Order Date as a starting place, then a parameter-based filter to choose a date.

           

          If you are trying to get the final date across the entire data set, you can use the parameter-based filter to flag this, I also set that up in the attached.

           

          Jonathan