Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Identifying Active Users | Sessionized Data Fundamentals
SQL for Product Analysts

bookIdentifying Active Users

What makes a user "active"? In product analytics, an active user is typically defined as someone who has engaged with your product within a specific time window—such as the past day, week, or month. The precise definition can vary by product, but it usually means the user has started at least one session, performed a meaningful action, or met another threshold of engagement. Your chosen definition has important implications: a stricter definition (such as requiring multiple sessions or specific actions) will result in a smaller, more engaged active user base, while a broader definition (such as any session activity) will include more users but may dilute the metric's value for tracking real engagement.

1234567
-- Find users with at least one session in the last 7 days SELECT DISTINCT u.user_id, u.name FROM users u JOIN sessions s ON u.user_id = s.user_id WHERE s.session_start >= CURRENT_DATE - INTERVAL '7 days';
copy

Filtering session data by date is crucial when measuring active users. By specifying a date range—such as the last 7 days—you ensure that only recent user activity is counted. This makes your active user metrics responsive to real changes in user behavior, rather than reflecting historical or inactive users. The choice of date window directly impacts your metric: a shorter window will capture only your most engaged users, while a longer window may include users who are less consistently active.

1234567
-- Calculate daily active users (DAU): count of distinct users per day SELECT DATE(s.session_start) AS activity_date, COUNT(DISTINCT s.user_id) AS daily_active_users FROM sessions s GROUP BY activity_date ORDER BY activity_date;
copy

Daily Active Users (DAU) is one of the core product metrics for understanding user engagement. DAU measures how many unique users interact with your product each day, providing a clear signal of daily usage trends. Product teams use DAU to monitor growth, spot sudden changes in engagement, and evaluate the impact of product changes or marketing campaigns. Because DAU counts unique users, it avoids inflating numbers due to multiple sessions by the same user in a single day, giving you a true sense of your daily reach.

Note
Definition

DAU (Daily Active Users) — the number of unique users who engage with a product in a single day.

1. What is a common SQL approach to identify active users?

2. Why is DAU an important metric for product teams?

3. How does filtering by date range affect active user calculations?

question mark

What is a common SQL approach to identify active users?

Select the correct answer

question mark

Why is DAU an important metric for product teams?

Select the correct answer

question mark

How does filtering by date range affect active user calculations?

Select the correct answer

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 5

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

bookIdentifying Active Users

Swipe um das Menü anzuzeigen

What makes a user "active"? In product analytics, an active user is typically defined as someone who has engaged with your product within a specific time window—such as the past day, week, or month. The precise definition can vary by product, but it usually means the user has started at least one session, performed a meaningful action, or met another threshold of engagement. Your chosen definition has important implications: a stricter definition (such as requiring multiple sessions or specific actions) will result in a smaller, more engaged active user base, while a broader definition (such as any session activity) will include more users but may dilute the metric's value for tracking real engagement.

1234567
-- Find users with at least one session in the last 7 days SELECT DISTINCT u.user_id, u.name FROM users u JOIN sessions s ON u.user_id = s.user_id WHERE s.session_start >= CURRENT_DATE - INTERVAL '7 days';
copy

Filtering session data by date is crucial when measuring active users. By specifying a date range—such as the last 7 days—you ensure that only recent user activity is counted. This makes your active user metrics responsive to real changes in user behavior, rather than reflecting historical or inactive users. The choice of date window directly impacts your metric: a shorter window will capture only your most engaged users, while a longer window may include users who are less consistently active.

1234567
-- Calculate daily active users (DAU): count of distinct users per day SELECT DATE(s.session_start) AS activity_date, COUNT(DISTINCT s.user_id) AS daily_active_users FROM sessions s GROUP BY activity_date ORDER BY activity_date;
copy

Daily Active Users (DAU) is one of the core product metrics for understanding user engagement. DAU measures how many unique users interact with your product each day, providing a clear signal of daily usage trends. Product teams use DAU to monitor growth, spot sudden changes in engagement, and evaluate the impact of product changes or marketing campaigns. Because DAU counts unique users, it avoids inflating numbers due to multiple sessions by the same user in a single day, giving you a true sense of your daily reach.

Note
Definition

DAU (Daily Active Users) — the number of unique users who engage with a product in a single day.

1. What is a common SQL approach to identify active users?

2. Why is DAU an important metric for product teams?

3. How does filtering by date range affect active user calculations?

question mark

What is a common SQL approach to identify active users?

Select the correct answer

question mark

Why is DAU an important metric for product teams?

Select the correct answer

question mark

How does filtering by date range affect active user calculations?

Select the correct answer

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 5
some-alt