Query editor
With Total_Discount_YFI_redeemed as (selectDATE_TRUNC('month', evt_block_time) as time,sum(value)/pow(10,18) as yfifrom erc20_ethereum.evt_Transferwhere "from" = 0x7dC3A74F0684fc026f9163C6D5c3C99fda2cf60aand (to <> 0xFEB4acf3df3cDEA7399794D0869ef76A6EfAff52 or to <> 0x93A62dA5a14C80f265DAbC077fCEE437B1a0Efde)GROUP BY 1),months AS (with month_seq as (SELECT(sequence(cast('2020-10-01' AS DATE),cast(NOW() AS DATE),interval '1' month)) month)SELECTmonths.monthFROM month_seqCROSS JOIN unnest (month) AS months (month))SELECTcast(month AS TIMESTAMP) AS month,COALESCE(YFI, 0) AS Discount_YFI_redeemed,SUM(COALESCE(YFI, 0)) over (ORDER BY cast(month AS TIMESTAMP)) AS Total_Discount_YFI_redeemedFROM monthsLEFT JOIN Total_Discount_YFI_redeemed t ON t.time = months.monthGROUP BY1, 2