# Query for WAU/MAU

**URL:** https://meta.discourse.org/t/query-for-wau-mau/252992
**Category:** Data & reporting
**Tags:** sql-query
**Created:** [January 26, 2023, 4:01pm UTC](https://meta.discourse.org/t/query-for-wau-mau/252992 "2023-01-26T16:01:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Tris20](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tris20/32/264639_2.png) [@Tris20](https://meta.discourse.org/u/Tris20)
#### Post date: [January 26, 2023, 4:01pm UTC](https://meta.discourse.org/t/query-for-wau-mau/252992/1 "2023-01-26T16:01:54Z")

</div>

With DAU/MAU I was also curious about a weekly equivalent. Below is a query for [data explorer](https://meta.discourse.org/t/32566?silent=true) that will give you the weekly active user count divided by the monthly active user count. Unfortunately it doesn’t have a history mechanic, so if you wanted to see how this metric varied on a weekly basis you would need to run the script once per week via api or manually and store the values somewhere.

```sql
WITH weekly_active_users_count AS(
  SELECT CAST(COUNT(DISTINCT u.id) AS NUMERIC)AS count
  FROM users u
  WHERE age(u.last_seen_at) < interval '7 days'
), monthly_active_users_count AS (
  SELECT CAST(COUNT(DISTINCT u.id) AS NUMERIC) AS count
  FROM users u
  WHERE age(u.last_seen_at) < interval '31 days'
)
SELECT 
  ROUND(weekly_active_users_count.count / monthly_active_users_count.count,2)*100  
  AS weekly_monthly_percentage
FROM weekly_active_users_count,monthly_active_users_count

```

For reference, my DAU/MAU rate is around the 20% mark, and WAU/MAU rate is around 54%. I feel the WAU/MAU rate is more suitable for a community that is tailored more towards intermittent usefulness rather than engagement.
