Download answer_key/kpis/consent_drift.sql from misatadata/pepperwind: direct link, hf CLI and curl.
- Browser
- Download file 709 Bytes
-
https://huggingface.co/datasets/misatadata/pepperwind/resolve/main/answer_key/kpis/consent_drift.sql
- Command line
-
hf download hf://datasets/misatadata/pepperwind/answer_key/kpis/consent_drift.sql
-
curl -L -o consent_drift.sql https://huggingface.co/datasets/misatadata/pepperwind/resolve/main/answer_key/kpis/consent_drift.sql
709 Bytes
| -- Customers subscribed in the store but unsubscribed or cleaned on the email platform, by platform status | |
| -- Storefront customers whose store consent reads subscribed while the email platform's latest status at the close is unsubscribed or cleaned: the platform's changes the store never received. | |
| WITH last AS (SELECT customer_id, arg_max(status, (captured_at, consent_id)) AS platform_status FROM marketing.consent WHERE captured_at < TIMESTAMP '2026-10-01' GROUP BY 1) SELECT l.platform_status AS grp, count(*) AS value FROM commerce.customer c JOIN last l USING (customer_id) WHERE c.email_marketing_consent_state = 'subscribed' AND l.platform_status IN ('unsubscribed', 'cleaned') GROUP BY 1 ORDER BY 1 | |