kenobi9270ALGO Transactions
    Updated 2022-03-29
    with quantities as(select sum(amount) as quantities ,block_timestamp::DATE as qdate from algorand.payment_transaction
    where qdate >= '2022-01-01' and asset_id=0
    group by qdate)
    , transactions as (
    select 'Payment Sizes 0-10 ALGOs' as psize, count(*) as transactions_count ,block_timestamp::DATE as pdate from algorand.payment_transaction
    where pdate >= '2022-01-01' and asset_id=0 and amount <= 10
    group by pdate

    union
    select 'Payment Sizes 10-100 ALGOs' as psize, count(*) as transactions_count ,block_timestamp::DATE as pdate from algorand.payment_transaction
    where pdate >= '2022-01-01' and amount > 10 and amount <= 100
    group by pdate

    union
    select 'Payment Sizes 100-1000 ALGOS' as psize, count(*) as transactions_count ,block_timestamp::DATE as pdate from algorand.payment_transaction
    where pdate >= '2022-01-01' and asset_id=0 and amount > 100 and amount <= 1000
    group by pdate

    union
    select 'Payment Sizes 1,000-10,000ALGOs' as psize, count(*) as transactions_count ,block_timestamp::DATE as pdate from algorand.payment_transaction
    where pdate >= '2022-01-01' and asset_id=0 and amount > 1000 and amount <= 10000
    group by pdate

    union
    select 'Payment Sizes 10,000+ ALGOs' as psize, count(*) as transactions_count ,block_timestamp::DATE as pdate from algorand.payment_transaction
    where pdate >= '2022-01-01' and asset_id=0 and amount >= 10000
    group by pdate
    )

    SELECT psize, pdate, transactions_count, sum(transactions_count) OVER (PARTITION BY psize ORDER BY pdate) as ptransactions
    FROM transactions
    Run a query to Download Data