nitsUntitled Query
    Updated 2022-02-11
    WITH exi as(SELECT distinct address as users_
    from algorand.account
    where account_closed='FALSE'),
    gov1 as (select *
    from algorand.payment_transaction
    where receiver = '57QZ4S7YHTWPRAM3DQ2MLNSVLAQB7DTK4D7SUNRIEFMRGOU7DMYFGF55BY')
    , all_votes as
    (select *, case when contains(vote, 'a') then 'a' else 'b' end as voted_at
    from
    (select * ,substring(TRY_BASE64_DECODE_STRING(tx_message:txn:note),10 ) as vote from gov1
    where not contains(vote, 'com') and vote is not NULL)
    where contains(vote, '5'))
    SELECT sender, max(committed_amount) as final_comittment
    from
    (select sender as s, committed_amount from
    (select *,substring(vote,8) as xyz,substring(xyz,1,len(xyz)-1) as committed_amount
    from
    (select * ,substring(TRY_BASE64_DECODE_STRING(tx_message:txn:note),10 ) as vote from gov1
    where contains(vote, 'com'))))
    GROUP by 1

    -- group by sender
    Run a query to Download Data