May 5, 2025
Imagine for a moment that you work for a gaming company. Imagine you've just been assigned a task to explore the data of one of the company's action games.
Now wouldn't be awesome if you could answer all your questions with one data set? In this post I'm going to share with you how to enrich event data so that your typical data set can be used for so much more.
The image below shows a sample of the data that you have to work with. Assume this data is sitting in a MySQL database.
So the first thing you do is write down a list of questions you'd like to answer.
This is what you come up with:
I acknowledge that there are a lot more interesting questions you could ask about this data set. Test yourself by writing your own list and then see how you'd answer them.
Let's start by getting the easy questions out of the way.
What is the trend of new signups?
To calculate this I'd simply filter the signed_up event and group by whichever time period I'm interested in.
In SQL it would look something like this:
SELECT
count (distinct user_id) as user_count,
date_trunct('month', event_sent_at) as signup_month
FROM
events
WHERE
event_name = "signed_up"
GROUP BY
2
ORDER BY
2 desc
The first thing I'd do to answer this question is enrich the data set with the weapon name. The weapon id is present so we can either do a vlookup (if we preferred to work in Excel) or a left join (in the case of Tableau or standard SQL).
Once I've got the weapon name as part of my data set I'd filter out all events but shot_fired and group by weapon name.
SELECT
count (distinct id) as event_count,
weapons.weapon_name
FROM
events
LEFT JOIN
weapons on events.weapon_id=weapons.id
WHERE
event_name = "shot_fired"
GROUP BY
2
ORDER BY
1 desc
This question is almost identical to the one above. Instead of enriching the data with weapon name, you'll bring stage name and then group by that dimension.
Now for the fun part, the tougher questions.
Most analysts would look at this problem and opt for building a data source where the primary table is the users table (this is assuming the creation date of the user is in that table). A lot of SQL would then be written to try and calculate if each user fired at least one shot, and did it within 14 days of signup.
To do this in Tableau I'd follow the steps below:
This one can be tricky because it really depends on how you define active. Let's assume that active is defined as creating 10 or more shot fired events in each of the first 3 months after signup.
Here is what I'd do:
This one is actually simpler than it looks.
I'd use the fixed formula to do a distinct count of character id on the user_id level.
The formula would look like this: {fixed user_id: countd(character_id)}.
I can now use that field as a filter, set it to >=3 and then distinct count user_id for that sample and divide by all users, similarly to how I did it in the question above.
Working with event data is a lot of fun but often you simply don't have all the data you need to answer key questions. This results in creating multiple data sources and a lot of wasted time.
I hope this post taught you that it is possible to enrich event data so you can manipulate the structure of the data set to answer almost any question.
It might not be the cleanest and standard way but as long as you understand the nuances involved in your data set you should be able to work quicker and provide more value.
Join 1k+ analysts who get our weekly newsletter.