Query editor
with profile00 as (SELECTprofileId,ctx,TRY_CAST(VARBINARY_TO_UINT256(VARBINARY_SUBSTRING(ctx, 33, 32)) AS BIGINT) AS offsetFROM test123_base.OspRouterImmutable_evt_ProfileCreated-- where date(from_unixtime("timestamp", 8, 0))>=date('2024-06-19')),profile01 as (SELECTVARBINARY_SUBSTRING(ctx,offset + 33,TRY_CAST(VARBINARY_TO_UINT256(VARBINARY_SUBSTRING(ctx, offset + 1, 32)) AS BIGINT)) AS app_id,ctx,profileIdFROM profile00),profile0 as (selectcount(distinct profileId) as profile_countfrom profile01where FROM_UTF8(app_id)='{{num1}}' or FROM_UTF8(app_id)='{{num2}}'),social_activity00 as (select somon_social_interations as social_interations,somon_points as pointsfrom dune.opensociallabs.opensocial_overview),membership00 as (select id,count(distinct user) as membership_user,sum(membership_cnt) as membership_count,sum(membership_revenue) as membership_revenuefrom(selectid,user,max("count") as membership_cnt,sum(amount/pow(10,18)) as membership_revenuefrom season_pass_base.SeasonPass_evt_SeasonPassPurchasedgroup by id,user)group by id),membership0 as (select max(id) as season,max_by(membership_user,id) as membership_user,max_by(membership_count,id) as membership_count,max_by(membership_revenue,id) as membership_revenuefrom membership00),membership1 as (select count(distinct user) as total_membership_user,sum(amount/pow(10,18)) as total_membership_revenuefrom season_pass_base.SeasonPass_evt_SeasonPassPurchased),erc4337userOps0 as (select count(1) as erc4337_User_Operationsfrom account_factory_base.OspAccountFactory_evt_AccountCreated as aa