Skip to content

Instantly share code, notes, and snippets.

@alexbaldwin
Created May 28, 2015 16:44
Show Gist options
  • Save alexbaldwin/81fe0407368f9e6204aa to your computer and use it in GitHub Desktop.
Save alexbaldwin/81fe0407368f9e6204aa to your computer and use it in GitHub Desktop.
Dataclip for New Users Monthly
WITH monthrollup as (
select count(*) as signups,
date_trunc('month', created_at) as date
from users
WHERE created_at >= current_date - interval '24 months'
group by 2
)
SELECT date,
signups
FROM monthrollup
WINDOW w as (order by date)
ORDER BY date ASC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment