flipsidecryptoBlocks, Avalanche, Current
    Updated 2023-12-13
    with test_data as (
    select
    *,
    max(max_block) over (order by test_timestamp) -
    min(min_block) over (order by test_timestamp) + 1 as total_blocks_at_time
    from
    bi_analytics.core.fact_data_observability_results

    ),
    proportions as (
    select
    blockchain,
    test_name,
    test_timestamp,
    blocks_impacted_count / total_blocks_at_time as proportion_impacted
    from
    test_data
    )
    select
    blockchain,
    test_name,
    max(test_timestamp) as latest_test,
    proportion_impacted as incomplete,
    1 - proportion_impacted as complete
    from proportions
    where blockchain = 'avalanche' and test_name = 'blocks'
    group by 1,2,4,5


    Run a query to Download Data