Query editor
WITH promo_sales AS (SELECTbuyer,CASE WHEN with_code IS NULL OR with_code = '' THEN '[none]' ELSE with_code END AS promo_code,SUM(TRY_CAST(nodes_purchased AS BIGINT)) AS purchased_amtFROM query_4359791WHEREtierID <> ''GROUP BYbuyer,CASE WHEN with_code IS NULL OR with_code = '' THEN '[none]' ELSE with_code END), repeated_buyers AS (SELECTbuyer,purchased_amt,ROW_NUMBER() OVER (ORDER BY buyer) AS iteration_indexFROM promo_salesCROSS JOIN UNNEST(SEQUENCE(1, purchased_amt) /* WARNING: Check out the docs for example of time series generation: https://dune.com/docs/query/syntax-differences/ */) AS t(x)WHEREpromo_code = 'defigen')SELECTiteration_index,buyer,purchased_amtFROM repeated_buyersWHERENOT iteration_index IS NULL