Query editor
with profile_created as (select json_value(vars, 'lax $.to') as user_address,json_value(vars, 'lax $.handle') as handle_name,replace(json_value(vars, 'lax $.handle'), '.lens', '') as short_name,(case when regexp_like(replace(json_value(vars, 'lax $.handle'), '.lens', ''), '^[0-9]+$') then 'Pure Digits'when regexp_like(replace(json_value(vars, 'lax $.handle'), '.lens', ''), '^[a-z]+$') then 'Pure Letters'else 'Mixed'end) as handle_type,call_block_time,output_0 as profile_id,call_tx_hashfrom lens_polygon.LensHub_call_createProfilewhere call_success = true),profiles_summary as (select (case when length(short_name) >= 20 then 20 else length(short_name) end) as name_length,handle_type,count(*) as name_countfrom profile_createdgroup by 1, 2),profiles_total as (select count(*) as total_profile_count,sum(case when handle_type = 'Pure Digits' then 1 else 0 end) as pure_digit_profile_count,sum(case when handle_type = 'Pure Letters' then 1 else 0 end) as pure_letter_profile_countfrom profile_created)select cast(name_length as varchar) || ' Chars' as name_length_type,handle_type,name_count,total_profile_count,pure_digit_profile_count,pure_letter_profile_countfrom profiles_summaryjoin profiles_total on trueorder by handle_type, name_length