HosseinUntitled Query
    Updated 2023-01-26
    with
    t2 as (
    select
    repo as repository,
    min(date_trunc('month', createdat)) as min_date
    from near.beta.github_activity
    group by 1
    )

    select
    date_trunc('month', createdat::date) as day,
    count(distinct t2.repository) as new_repositories_count,
    count(distinct a.repo) as active_repositories_count,
    sum(new_repositories_count) over(order by day) as cumulative_new_repositories_count,
    sum(active_repositories_count) over(order by day) as cumulative_active_repositories_count
    from near.beta.github_activity a
    left join t2
    on a.createdat::date = t2.min_date::date
    group by 1
    Run a query to Download Data