Skip to content

Instantly share code, notes, and snippets.

@ddikman
Created November 8, 2021 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddikman/f5308ca1d513c5495953f5751b68ce0a to your computer and use it in GitHub Desktop.
Save ddikman/f5308ca1d513c5495953f5751b68ce0a to your computer and use it in GitHub Desktop.
Example of
SELECT
case user.value.string_value
when '0' then 'Baseline'
when '1' then 'Other version'
else 'Error'
end as experiment_value,
count(distinct(user_pseudo_id)) as users,
count(*) as events,
(count(*) / count(distinct(user_pseudo_id))) as ratio
FROM `<project_name>.analytics_<id>.events_*`,
UNNEST(user_properties) as user
where event_name = 'view_item'
and user.key = 'firebase_exp_0'
group by experiment_value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment