Download answer_key/kpis/email_open_rate.sql from misatadata/pepperwind: direct link, hf CLI and curl.
- Browser
- Download file 731 Bytes
-
https://huggingface.co/datasets/misatadata/pepperwind/resolve/main/answer_key/kpis/email_open_rate.sql
- Command line
-
hf download hf://datasets/misatadata/pepperwind/answer_key/kpis/email_open_rate.sql
-
curl -L -o email_open_rate.sql https://huggingface.co/datasets/misatadata/pepperwind/resolve/main/answer_key/kpis/email_open_rate.sql
731 Bytes
| -- Email unique open rate (human opens) | |
| -- Delivered emails sent in the month opened at least once by a person (machine opens left out), over delivered emails. | |
| SELECT strftime(s.sent_at, '%Y-%m') AS month, count(*) FILTER (WHERE h.send_id IS NOT NULL) AS hit, count(*) AS delivered, count(*) FILTER (WHERE h.send_id IS NOT NULL)::DOUBLE / count(*) AS value FROM marketing.email_send s JOIN (SELECT DISTINCT send_id FROM marketing.email_event WHERE type = 'delivered') d USING (send_id) LEFT JOIN (SELECT DISTINCT send_id FROM marketing.email_event WHERE type = 'open' AND NOT coalesce(is_machine_open, false)) h USING (send_id) WHERE s.sent_at >= TIMESTAMP '2023-10-01' AND s.sent_at < TIMESTAMP '2026-10-01' GROUP BY 1 ORDER BY 1 | |