Is this the correct syntax? I am using the traditional method of (new/old)-1 to work out the % difference between yesterday's registrations and a week from yesterday's registrations. I am getting '0' which does not seem right...
select
sum(case when (timestampregistered::date = current_date - 1) then 1 else 0 end)
/ sum(case when timestampregistered::date = current_date - 8 then 1 else 0 end) - 1 as pct_diff
from customers_table