I am working on a request to count the number of unique registered members in a table for the below date buckets (based on registration_date_utc - timestamp),
Jan 1-Mar 31: Count of Unique registered members
Feb 1-Apr 30: Count of Unique registered members
Mar 1-May 31: Count of Unique registered members
Apr 1-Jun 30: Count of Unique registered members
May 1-Jul 31: Count of Unique registered members
Jun 1-Aug 31: Count of Unique registered members
Jul 1-Sep 30: Count of Unique registered members
Aug 1-Oct 31: Count of Unique registered members
Sep 1-Nov 30: Count of Unique registered members
Oct 1-Dec 31: Count of Unique registered members
Below is my Snowflake query which works but it doesn't return any result,
select
DATE_TRUNC('month',t.registration_date_utc) as "MONTH_START",
count(distinct t.MEMBER_ID)
FROM
(
select
member_id,
registration_date_utc
from table a
) as t
WHERE TO_DATE(t.registration_date_utc) BETWEEN DATEADD(month,'3',t.registration_date_utc) AND t.registration_date_utc
group by 1
order by 1;