Acumen wants to identify its most engaged users in each region. Write a PostgreSQL query that calculates engagement scores from recent Acumen activity and returns the top three ranks per region, preserving ties.
Use 2026-08-29 12:00:00+00 as the report timestamp so the result is reproducible. The reporting window includes events from the preceding 30 days, including the timestamp boundary.
Requirements
- Join users to engagement events and event types to calculate each user's score.
- Assign points from
event_types.points and treat users with no scored activity as having a score of zero.
- Rank users independently within each region using a tie-aware window function.
- Return every user whose rank is at most 3, including all users tied at the third rank.
- Order results by region, rank, and user ID.
Representative data