Tableau數(shù)據(jù)分析訓(xùn)練營之LOD專題-5-篩選中使用聚合

SELECT?
market, `customer id`, `order date`,?
COUNT(`customer id`) OVER (PARTITION BY market?
??ORDER BY `order date`) AS Acc_Count
FROM (
SELECT DISTINCT?
o.market, o.`customer id`, o.`order date`
FROM global_orders o?
INNER JOIN (
SELECT?
`customer id`, MIN(`order date`) AS first_purchase_date
FROM global_orders
GROUP BY `customer id`) c?
ON o.`customer id` = c.`customer id`?
AND o.`order date` = c.first_purchase_date
) t
標(biāo)簽: