Google BigQuery Daily Imports Help

Hey,
So in BigQuery I've got a table full of data for each day:
app_events_20180201
app_events_20180202
etc. etc. what I'm trying to do is create a query in the connector that will simply run and append yesterdays data. I've been playing around with things like
select user_id
from app_events_DATE_FORMAT(current_date - 1, “%Y%m%d”)
or
from "app_events_"+"DATE_FORMAT(current_date - 1, “%Y%m%d”)"
but I can't seem to get anything to work. Has anyone else figured out a simple way to append each days data aside from going in everyday and changing the table name?
Best Answer
-
We just used regex in the query statement to find yesterdays table via the suffix and pull in all the data from it.
REGEXP_CONTAINS(_TABLE_SUFFIX, r'^\d{8}$') AND PARSE_DATE("%E4Y%m%d", _TABLE_SUFFIX) BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY) AND CURRENT_DATE()
0
Answers
-
Is anyone able to help out with this request?
Thanks,
0 -
We just used regex in the query statement to find yesterdays table via the suffix and pull in all the data from it.
REGEXP_CONTAINS(_TABLE_SUFFIX, r'^\d{8}$') AND PARSE_DATE("%E4Y%m%d", _TABLE_SUFFIX) BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY) AND CURRENT_DATE()
0
Categories
- All Categories
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 311 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3.8K Transform
- 657 Datasets
- 115 SQL DataFlows
- 2.2K Magic ETL
- 815 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 81 App Studio
- 45 Variables
- 775 Automate
- 190 Apps
- 481 APIs & Domo Developer
- 81 Workflows
- 23 Code Engine
- 40 AI and Machine Learning
- 20 AI Chat
- 1 AI Playground
- 1 AI Projects and Models
- 18 Jupyter Workspaces
- 410 Distribute
- 120 Domo Everywhere
- 280 Scheduled Reports
- 10 Software Integrations
- 144 Manage
- 140 Governance & Security
- 8 Domo Community Gallery
- 48 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 114 Community Announcements
- 4.8K Archive