walemathsnew contract and unique contract monthly bias
    Updated 2024-07-02
    with news as (
    select
    distinct event_contract as new_contract,
    min(trunc(block_timestamp, 'month')) as debut
    from
    flow.core.fact_events
    group by 1
    )
    select
    debut as month,
    count(distinct new_contract) as new_contracts,
    sum(count(distinct new_contract)) over (order by debut) as unique_contracts
    from
    news
    group by 1
    order by 1 asc;

    QueryRunArchived: QueryRun has been archived