DENSE_RANK: top 3 channels, web, since February 2025
Instructions
Consider users with the platform 'web' whose referrer is not NULL, and their purchases made on or after February 1, 2025. For each pair (country users.country, channel users.referrer) compute the metric buyers: the number of distinct users with this referrer who have purchases; pairs without such purchases are not considered. Within a country, rank the channels by the metric descending using DENSE_RANK(): channels with an equal metric get the same place, and the next place is not skipped. Output the channels with place <= 3; because of ties there may be more than 3 of them in a country. Columns: country, referrer, buyers, place. Row order does not matter.
Hints
Each next one is more detailed and costs more
Query
Result
Click Run to see the query result, or Check to submit your solution.
Dataset schema
Table relationships
- N:1Many-to-one
events.→user_id users.id - N:1Many-to-one
purchases.→user_id users.id
Table data
Select a table in the diagram or list to view its rows.