daniel1234567Negative Test Query
    Updated 2022-12-13
    cosmos.core.fact_blockscosmos.core.fact_blockscosmos.core.fact_blockscosmos.core.fact_blocks-- Test Query 2.1 — Weekly Time Series, Numerical, Categorical (5), NEGATIVE

    with big_spenders as (
    select
    buyer_address as buyer_address,
    sum(price_usd) + sum(total_fees_usd) as total_spend
    from ethereum.core.ez_nft_sales
    where
    date_trunc ('day', block_timestamp) > current_date - interval '12 weeks' and
    total_fees_usd is not null
    group by 1 order by 2 desc limit 5
    ),
    actuals as(
    SELECT
    date_trunc ('week', block_timestamp) as date,
    buyer_address,
    sum(total_fees_usd) as total_fees,
    sum(price_usd) as total_price,
    sum(total_fees_usd) + sum(price_usd) as total_cost,
    sum(total_fees_usd) / (sum(total_fees_usd) + sum(price_usd)) as fee_percent
    FROM ethereum.core.ez_nft_sales
    where
    buyer_address in (
    select
    buyer_address
    from
    big_spenders
    ) and
    date_trunc ('week', block_timestamp) > current_date - interval '52 weeks'
    group by 1, 2
    )

    select
    *,
    -total_cost as neg_total_cost,
    Run a query to Download Data