pepperwind / answer_key /kpis /b2b_accounts_created.sql
rasinmuhammed's picture
Pepperwind Trading Co. preview, version 1.0
27ec678 verified
Raw History Blame Contribute Delete
327 Bytes
-- Wholesale accounts created, by segment
-- CRM accounts not deleted by the month created.
SELECT strftime(CreatedDate, '%Y-%m') AS month, Segment__c AS grp, count(*) AS value FROM crm.account WHERE CreatedDate >= TIMESTAMP '2023-10-01' AND CreatedDate < TIMESTAMP '2026-10-01' AND (NOT IsDeleted) GROUP BY 1, 2 ORDER BY 1, 2