Ian Goldsbrough
Ian Goldsbrough

Reputation: 3

Querying multiple date based tables in bigquery

I'm new to Tableau and BigQuery and have just linked the two. However I'm having trouble with the TABLE_DATE_RANGE - which would allow me to join the tables over specific time period.

This query works in BQ:

SELECT fullVisitorId FROM (TABLE_DATE_RANGE([78004876.ga_sessions_],TIMESTAMP('2014-08-01'),TIMESTAMP('2014-08-19')));

however not in Tableau. When I replace with parameters it just errors out.

SELECT fullVisitorId FROM (TABLE_DATE_RANGE([78004876.ga_sessions_],,);

error: Encountered " ";" ";"" at line 1, column 156 Was expecting: ")" ...

any help would be appreciated

thanks

Upvotes: 0

Views: 1791

Answers (1)

hoggkm
hoggkm

Reputation: 280

You are almost there. It looks as if you are trying to make the dates flexible in Tableau. If this is the case, all you need to do is add a few parameters to your Tableau file for the begining and ending date. After which, your query would actually look something like this:

SELECT fullVisitorId FROM TABLE_DATE_RANGE([78004876.ga_sessions_],<Parameters.Start_Date>,<Parameters.End_Date>);

Additionally, you had an orphaned "(" symbol after the "FROM" Keyword that I removed

Also Note: You must create the parameters and give them valid values (Actual tables that exist in your Big Query Data-set) before connecting to the data source.

Upvotes: 1

Related Questions