I very carefully read
https://www.metabase.com/docs/latest/users-guide/13-sql-parameters.html#the-field-filter-variable-type ,
https://www.metabase.com/learn/sql-questions/field-filters
and discourse, but there are not answer.
I try to use Field filter with Bigquery but there is error "Unrecognized name: analytics_264308021.events
at [8:9]"
Question is:
SELECT
count(*) as cnt,
'{{event_name}}' as what_is_in_filter
FROM security-master-75d2d.analytics_264308021.events
WHERE
event_date_date = '2021-08-30'
AND {{event_name}}
Query in Bigquery is:
-- Metabase:: userID: 1 queryType: native queryHash: 75ac8da465127c2dc5d040cefd4976af235543ad596f1735af6b5cf8e42a06ba
SELECT
count(*) as cnt,
'analytics_264308021.events
.event_name
IN (?)' as what_is_in_filter
FROM security-master-75d2d.analytics_264308021.events
WHERE
event_date_date = '2021-08-30'
AND analytics_264308021.events
.event_name
IN (?)
Error is in line:
AND analytics_264308021.events
.event_name
IN (?)
If run query without dataset_name "analytics_264308021" or with project_id prefix before dataset_name "security-master-75d2d.analytics_264308021", there are not any errors:
Both is correct:
AND event_name
IN (?)
AND security-master-75d2d.analytics_264308021.events
.event_name
IN (?)
What is right way to use Field Filter with Bigquery (without dataset_name or with project_id before dataset_name)?
flamber
September 2, 2021, 10:03am
2
Hi @alexklklkl
Your from-clause should be without Project ID.
FROM `analytics_264308021.events`
Big big big thanks, it is very helpfull!
Hey @flamber
How's it going?
UP in this old thread (kkkrying)
I opened this issue here
opened 10:31PM - 14 Aug 23 UTC
**Describe the bug**
When creating a new field filter, mapped on Metabase by us… ing the native SQL questions.
It presents an error when running the query
**Logs**
> 400 Bad Request POST https://www.googleapis.com/bigquery/v2/projects/<< MY PROJECT >>/queries { "code" : 400, "errors" : [ { "domain" : "global", "location" : "q", "locationType" : "parameter", "message" : "Unrecognized name: `prod_activation.movimentos` at [5:20]", "reason" : "invalidQuery" } ], "message" : "Unrecognized name: `prod_activation.movimentos` at [5:20]", "status" : "INVALID_ARGUMENT" }
**To Reproduce**
Steps to reproduce the behavior:
1. Go to a new SQL native question
2. add a {{variable}} in the code
> WHERE {{data_de_cadastro_titulo}}
3. Set the variable as Field Filter and find the field among the tables
4. Set the variable type as Date Filter
5. Mandatory = NO
6. Default Value = not set
7. add a date in the question filter
8. run the query
9. See the error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**


**Severity**
I could not create more filters on my Dashboard. This was requested by my Customer
**Additional context**
Looking at Metabase SQL output

the only way that I got to run this was by removing the dataset and tablename form the date_trunc, generated by Metabase
Instead of this
> WHERE date_trunc(`prod_activation.movimentos`.`data_de_cadastro_titulo`, day) BETWEEN date "2023-08-06"
AND date "2023-08-12"
Running this
> WHERE date_trunc(`data_de_cadastro_titulo`, day) BETWEEN date "2023-08-06"
AND date "2023-08-12"
**Metabase Diagnostic Info**
```json
{
"browser-info": {
"language": "en-US",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.20+8",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.20",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.20+8",
"os.name": "Linux",
"os.version": "4.4.0",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"bigquery-cloud-sdk"
],
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "14.7"
},
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.5.1"
}
},
"run-mode": "prod",
"version": {
"date": "2023-08-06",
"tag": "v0.46.7",
"branch": "release-x.46.x",
"hash": "cfdf23b"
},
"settings": {
"report-timezone": null
}
}
}
```
Even trying to avoid field filter gotchas, there's a strange behavior on it (Better described in the issue)
tks in advance