I'm trying to calculate a running % from the result of two counts (as shown in the SQL excerpt below) from a table in normal SQL that looks like this:
My thoughts are this:
SELECT week(beginning),
(select count(enquired_at) from TABLE) / (select count(*) from TABLE) * 100 OVER (partition by beginning order by beginning desc)
I would like a result set that looks like this:
How would a person take this arithmetic calculation and make it so that it calculates cumulatively from Week 1 of beginning onwards?
Thanks!