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
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 627 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive