https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
b

billowy-byte-48939

08/18/2023, 9:26 AM
We are creating a query to get data from GA4 (BigQuery) . We want to see the data in real-time on the day we start the test, but the default query in GrowthBook only refers to the daily table, so we cannot see the data in the intraday table. Has anyone already created a query that references both the events_ and events_intraday_ tables at the same time?
w

white-fireman-22476

08/18/2023, 9:34 AM
I haven't done this before, so I'm not confident that it is the right approach. But perhaps you could try out
(<query you have now>) UNION (<query you have now but replacing the FROM with the events_intra_day>)
b

billowy-byte-48939

08/18/2023, 9:42 AM
Great, it worked! (I used
UNION all
) Thank you😄
w

white-fireman-22476

08/18/2023, 9:45 AM
Glad to hear it. Yes doing
UNION all
might be more efficient but could lead to duplicates in the general sense, but I believe the events in the intraday tables are not yet in any events table. But perhaps during switch over times there is a chance an event might appear in both? I haven't researched that myself yet, so just don't know.
b

billowy-byte-48939

08/18/2023, 9:50 AM
Right. The intraday table should be deleted when the events_ table is created, but I have not investigated the exact timing. Perhaps there could be a timing when two tables exist for the same day. I will try to change it to use Distinct.
w

white-fireman-22476

08/18/2023, 9:53 AM
UNION
does do a distinct over the entire row.
b

billowy-byte-48939

08/18/2023, 9:55 AM
I receive an error with just
UNION
w

white-fireman-22476

08/18/2023, 9:55 AM
ah ok.
Then doing ``SELECT DISTINCT * FROM (<Current query with the UNION ALL bit>)`` might get at the same thing.
b

billowy-byte-48939

08/18/2023, 10:16 AM
Oh thanks!!
m

microscopic-table-65564

09/12/2023, 9:18 PM
I know this thread is a bit old, but I am trying to do the same thing. But I don’t know how to edit the queries to do the union with the intraday table. Any help would be appreciated!
w

white-fireman-22476

09/13/2023, 7:15 AM
Hi Yesi. You can click on the three dots and click edit.
Then click the Customize SQL button.
m

microscopic-table-65564

09/13/2023, 2:19 PM
Ahh got it, thank you!
15 Views