Query editor
with nft_balance as(select id,sum(value) as balance from(selectid,-cast((value) as double) as valuefrom erc1155_ethereum.evt_TransferSinglewhere contract_address=0x76BE3b62873462d2142405439777e971754E8E77and "to"=0x0000000000000000000000000000000000000000and 1 <= {{Synchronize}}union allselectid,cast((value) as double) as valuefrom erc1155_ethereum.evt_TransferSinglewhere contract_address=0x76BE3b62873462d2142405439777e971754E8E77and "from"=0x0000000000000000000000000000000000000000union allselectid, -cast(value as double) as valuefrom erc1155_ethereum.evt_TransferBatchcross join unnest("ids","values") as tbl(id,value)where contract_address=0x76BE3b62873462d2142405439777e971754E8E77and "to"=0x0000000000000000000000000000000000000000union allselectid,cast(value as double) as valuefrom erc1155_ethereum.evt_TransferBatchcross join unnest("ids","values") as tbl(id,value)where contract_address=0x76BE3b62873462d2142405439777e971754E8E77and "from"=0x0000000000000000000000000000000000000000)group by 1)SELECT "Parallel", SUM(balance) AS balance,-- (SUM(balance) / SUM(SUM(balance)) OVER ()) AS percentage,SUM(SUM(balance)) OVER (ORDER BY "Parallel" ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cumulative_balanceFROM (SELECT *FROM nft_balance nbLEFT JOIN query_3048276 md ON CAST(nb.id AS VARCHAR) = CAST(md."Token ID" AS VARCHAR)WHERE nb.balance > 0)WHERE "Class" IN ('First Edition', 'SE', 'PL')-- WHERE "Parallel" = 'Augencore'GROUP BY 1;