granadohoPercentage of Sales above 1 SOL and 10 SOL
    Updated 2022-04-25
    with total as (
    select
    count(distinct tx_id) as total_sales,
    sum(case when sales_amount > 1 then 1 Else 0 End) as sales_above_1_sol,
    sum(case when sales_amount > 10 then 1 Else 0 End) as sales_above_10_sol
    from solana.fact_nft_sales
    where succeeded = 'TRUE'
    )

    (
    select
    'Above 1 SOL' as metrics,
    ((total_sales - sales_above_1_sol)/total_sales)*100 as perc_sales_below_1_sol,
    (sales_above_1_sol/total_sales) * 100 as perc_sales_above_1_sol,
    NULL as perc_sales_below_10_sol,
    NULL as perc_sales_above_10_sol
    from total
    )

    UNION

    (
    select
    'Above 10 SOL' as metrics,
    NULL as sales_below_1_sol,
    NULL as sales_above_1_sol,
    ((total_sales - sales_above_10_sol)/total_sales) * 100 as sales_below_10_sol,
    (sales_above_10_sol/total_sales) * 100 as perc_sales_above_10_sol
    from total
    )
    Run a query to Download Data