Download answer_key/kpis/consent_subscribed_share.sql from misatadata/pepperwind: direct link, hf CLI and curl.
- Browser
- Download file 467 Bytes
-
https://huggingface.co/datasets/misatadata/pepperwind/resolve/main/answer_key/kpis/consent_subscribed_share.sql
- Command line
-
hf download hf://datasets/misatadata/pepperwind/answer_key/kpis/consent_subscribed_share.sql
-
curl -L -o consent_subscribed_share.sql https://huggingface.co/datasets/misatadata/pepperwind/resolve/main/answer_key/kpis/consent_subscribed_share.sql
467 Bytes
| -- Consent records subscribed to marketing | |
| -- Consent records captured in the month with status subscribed, over all captured. | |
| SELECT strftime(captured_at, '%Y-%m') AS month, sum(CASE WHEN status = 'subscribed' THEN 1 ELSE 0 END) AS num, sum(1) AS den, sum(CASE WHEN status = 'subscribed' THEN 1 ELSE 0 END) / NULLIF(sum(1), 0) AS value FROM marketing.consent WHERE captured_at >= TIMESTAMP '2023-10-01' AND captured_at < TIMESTAMP '2026-10-01' GROUP BY 1 ORDER BY 1 | |