Download answer_key/kpis/cac.sql from misatadata/pepperwind: direct link, hf CLI and curl.
- Browser
- Download file 726 Bytes
-
https://huggingface.co/datasets/misatadata/pepperwind/resolve/main/answer_key/kpis/cac.sql
- Command line
-
hf download hf://datasets/misatadata/pepperwind/answer_key/kpis/cac.sql
-
curl -L -o cac.sql https://huggingface.co/datasets/misatadata/pepperwind/resolve/main/answer_key/kpis/cac.sql
726 Bytes
| -- Paid media cost per new storefront customer, by market | |
| -- Paid media spend in a market's currency in the month over customer accounts created there in it. | |
| WITH a AS (SELECT strftime(date, '%Y-%m') AS month, market_code, sum(cost) AS spend FROM marketing.ad_spend_daily WHERE date >= TIMESTAMP '2023-10-01' AND date < TIMESTAMP '2026-10-01' GROUP BY 1, 2), c AS (SELECT strftime(created_at, '%Y-%m') AS month, market_code, count(*) AS new_customers FROM commerce.customer WHERE created_at >= TIMESTAMP '2023-10-01' AND created_at < TIMESTAMP '2026-10-01' GROUP BY 1, 2) SELECT a.month, a.market_code AS grp, a.spend, c.new_customers, a.spend / c.new_customers AS value FROM a JOIN c USING (month, market_code) ORDER BY 1, 2 | |