SQL code problems with the calculate churm exercise from data analysis path course

Right now I am doing the SQL project calculate churn rates from the Data Analysis path course but I a have been having some code problems that dont let me get trough the project, can anyone help me? I will leave my the code here in the post together with the link to the project.

CODE:

WITH months AS (
SELECT
 "2017-01-01" as first_day,
 "2017-01-31" as last_day
UNION
SELECT
 "2017-02-01" as first_day,
 "2017-02-28" as last_day
UNION
SELECT
 "2017-03-01" as first_day,
 "2017-03-31" as last_day;
),
 
cross_join as (
  SELECT * FROM subscriptions
  CROSS JOIN months
), status as (
  SELECT id,first_day as month_, 
  CASE 
   WHEN segment = 87 AND(subscription_start < first_day)
  AND (subscription_end > month_) OR (subscription_end IS NULL)
    THEN 1
    ELSE 0
   END as is_active_87,
   CASE
    WHEN segment = 30 AND (subscription_start < first_day) AND (subscription_end > month_) OR (subscription_end IS NULL)
     THEN 1
     ELSE 0
    END as is_active_30,
   CASE
    WHEN segment = 87 AND subscription_end BETWEEN month_ AND months.last_day 
    THEN 1
    ELSE 0
   END as is_canceled_87,
   CASE
    WHEN segment = 30 AND subscription_end BETWEEN month_ AND months.last_day 
    THEN 1
    ELSE 0
   END as is_canceled_30
    FROM cross_join;
),status_aggregate as
(SELECT SUM(is_active_87) as sum_active_87,SUM(is_active_30) as sum_active_30,SUM(is_canceled_87) as sum_canceled_87,SUM(is_canceled_30) as sum_canceled_30 FROM status;)
 
SELECT months, (1.0 * status_aggregate.sum_active_87/status_aggregate.is_canceled_87) as churn_rate FROM status_aggregate
GROUP BY month;

LINK:
https://www.codecademy.com/paths/data-science/tracks/analyze-data-sql-analyze-real-data/modules/analyze-data-sql-user-churn/projects/calc-churn-proj

image
also:
image

Hi there,
I have got 0 for the ‘sum_canceled_87’ and ‘sum_canceled_87’. Can anyone help?

here is mu status temporary table:

status AS
(SELECT id, first_day AS MONTH,
CASE
when (subscription_start < first_day
and (subscription_end > first_day or subscription_end is NULL)) and segment = 87 then 1
else 0
end as is_active_87,
case
when (subscription_start < first_day
and (subscription_end > first_day or subscription_end is NULL)) and segment = 30 then 1
else 0
end as is_active_30,
case
when (subscription_end between first_day and last_day) and segment = 87 then 1
else 0
end as is_canceled_87,
case
when (subscription_end between first_day and last_day) and segment = 30 then 1
else 0
end as is_canceled_30
from cross_join