Query editor
WITH exploded_data AS (SELECTTRY_CAST(call_block_time AS DATE) AS mint_date,to_address,amountFROM alo_aspen_collection_2023_polygon.HyperMintERC1155_2_2_0_call_mintBatchCROSS JOIN UNNEST(_to) AS t(to_address)CROSS JOIN UNNEST(_amounts) AS a(amount)), aggregated_data AS (SELECTmint_date,to_address,COUNT(*) AS to_count,SUM(TRY_CAST(element AS INTEGER)) AS total_amountFROM exploded_dataCROSS JOIN UNNEST(amount) AS u(element)GROUP BYmint_date,to_address)SELECTmint_date,to_address,to_count,total_amountFROM aggregated_dataORDER BYmint_date,to_address;