Skip to content

Instantly share code, notes, and snippets.

@allyburns
Created June 14, 2023 12:41
Show Gist options
  • Save allyburns/a6b3a43e8ec092854389d127828d5778 to your computer and use it in GitHub Desktop.
Save allyburns/a6b3a43e8ec092854389d127828d5778 to your computer and use it in GitHub Desktop.
ga_code_0003_query across istraday.sql
SELECT DISTINCT(_table_suffix)
FROM `example_project.analytics_348840650.events_*`
WHERE REGEXT_EXTRACT(_table_suffix, r'[0-9]+')
BETWEEN FORMAT_DATE('%Y%m%d',date_sub(CURRENT_DATE(), interval 7 day))
AND FORMAT_DATE('%Y%m%d', CURRENT_DATE())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment