Data Studio
5.1K members online now
5.1K members online now
Ask questions about Data Studio
Guide Me
star_border
Reply

[BUG REPORT] Default date range not working for "last X days" with BigQuery source

Explorer ✭ ☆ ☆
# 1
Explorer ✭ ☆ ☆

I'm using a BQ query as a data source, and attempting to set a Default Date Range using a field, let's call it "date_field".

 

When I choose "Last 28 days" (for example), no data is returned to my chart.

 

I can see inside BigQuery that when I refresh my DS report, a query is run by DS with the following conditions in a wrapper:

 

WHERE (t0.date_field >= '20170609' AND t0.date_field <= '20170706')

 

Understandably, that wrapper is just placing my query in a subquery and then filtering/ordering based on my selections and settings inside the DS report. That makes sense.

 

It's just that the date-range filtering happening in that wrapper query isn't working. No results are returned inside BQ, and so no results show up inside DS.

 

However, if I change the conditions by placing dashes inside those dates, like:

 

WHERE (t0.date_field >= '2017-06-09' AND t0.date_field <= '2017-07-06')

 

...then the query works just fine! Results are returned inside BQ, and I presume that DS would pick those results up.

[BUG REPORT] Default date range not working for &quot;last X days&quot; with BigQuery source

Explorer ✭ ✭ ✭
# 2
Explorer ✭ ✭ ✭

I think you're going to have to either modify the date field in BQ to match what Data Studio is trying to run, or what may be easier is you may be able to edit/format the date field directly in Data Studio to add '-' in your date field and then see if the dashes get passed along in the query.