with bounty_counts AS (
select
date_trunc('month', start_at) AS month,
count(distinct id) AS bounty_count
from "BI_ANALYTICS"."SILVER"."BOUNTIES"
where month is not null
group by month
),
analyst_counts AS (
SELECT
date_trunc('month', s.created_at) AS month,
count(distinct s.created_by_id) AS analyst_count
from "BI_ANALYTICS"."SILVER"."SUBMISSIONS" s
group by month
)
SELECT
b.month,
bounty_count,
analyst_count
from bounty_counts b
left join analyst_counts a
on b.month = a.MONTH
order by b.month desc