HosseinUntitled Query
Updated 2023-01-23
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
›
⌄
with
t1 as (
select
b.block_timestamp,
proposal_id,
tx_id,
voter,
b.message_value:content:title as title,
b.message_value:content:description as description
from terra.core.fact_governance_submit_proposal a
join terra.core.ez_messages b
using(tx_id)
join terra.core.fact_governance_votes
using(proposal_id)
)
select
block_timestamp::date as day,
concat(title, ' (Id: ', proposal_id, ')') as proposal,
count(distinct tx_id) as votes_count,
count(distinct voter) as voters_count,
sum(votes_count) over (partition by proposal_id order by day) as cumulative_votes_count,
sum(voters_count) over (partition by proposal_id order by day) as cumulative_voters_count
from t1
where proposal_id >= 3619
group by day, proposal_id, title
order by day, proposal_id
Run a query to Download Data