Query editor
with_payments as (select*from-- query_5339108query_5369127)selectblock_date,sum(case when payment_type = 'TG Stars' then amount end) as tg_stars_amount_usd,count(distinct case when payment_type = 'TG Stars' then address end) as tg_stars_unique,sum(case when payment_type = 'TG Stars Reward from bot' then amount end) as reward_from_bot_amount_usd,count(distinct case when payment_type = 'TG Stars Reward from bot' then address end) as reward_from_bot_unique,sum(case when payment_type = 'TG Premium' then amount end) as tg_premium_amount_usd,count(distinct case when payment_type = 'TG Premium' then address end) as tg_premium_unique,sum(case when payment_type = 'TG Ads Rewards' then amount end) as tg_ads_rewards_amount_usd,count(distinct case when payment_type = 'TG Ads Rewards' then address end) as tg_ads_rewards_unique,sum(case when payment_type = 'TG Ads Top Up' then amount end) as tg_ads_top_up_amount_usd,count(distinct case when payment_type = 'TG Ads Top Up' then address end) as tg_ads_top_up_uniquefrom_paymentsgroup by1