Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Efficient filtering of tables in google analytics
SELECT
count(*)
FROM
`<your_project>.analytics_196169157.events_*`
WHERE
event_name = 'event_name'
AND _TABLE_SUFFIX >= format_date('%Y%m%d', CURRENT_DATE() - 30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment