HI, I am trying to use a filter for date in sql, My code is like this:
SELECT SUM(secoes) secoes FROM (SELECT SUM(ga_sessions) secoes, PARSE_DATE("%Y%m%d",ga_date) data
FROM projeto.dataset.tabela
[[WHERE data = {{data}}]]
GROUP BY data) table_a
I try this also:
WITH Table_a AS (SELECT SUM(ga_sessions) secoes, PARSE_DATE("%Y%m%d",ga_date) data
FROM projeto.dataset.tabela
GROUP BY data)
SELECT SUM(secoes) secoes FROM Table_a
[[WHERE data = {{data}}]]
And the date filter not appear a field to select in dash.
The other problem is with a simple question, I have a column with 37 distinct values and can not be filtered using a category field.
My version:
{
"browser-info": {
"language": "en-US",
"platform": "Linux x86_64",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "1.8.0_242-8u242-b08-0ubuntu3~18.04-b08",
"java.vendor": "Private Build",
"java.vendor.url": "http://java.oracle.com/",
"java.version": "1.8.0_242",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "25.242-b08",
"os.name": "Linux",
"os.version": "4.15.0-1057-aws",
"user.language": "en",
"user.timezone": "Etc/GMT+3"
},
"metabase-info": {
"databases": [
"bigquery",
"postgres",
"h2"
],
"hosting-env": "unknown",
"application-database": "postgres",
"run-mode": "prod",
"version": {
"tag": "v0.34.1",
"date": "2020-01-13",
"branch": "release-0.34.x",
"hash": "265695c"
},
"settings": {
"report-timezone": "America/Sao_Paulo"
}
}
}