nitsGovernance Voting Period 2 decisions
    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 voted_at, count(sender) as number_of_votes from
    (select * from (select max(block_id) as last_vote_time,sender as s, voted_at as v
    from all_votes
    group by sender, voted_at )
    inner join all_votes
    on s =sender and v=voted_at)
    group by voted_at
    --where tx_id = 'NIGFDSGG5QS6MMTUQZ6QYSAXXZI4ZOUNIO5MUO6NDMLFGZFT2TJQ' TRY_BASE64_DECODE_STRING
    limit 100
    Run a query to Download Data