Problems with variable in SQL question

Diagnostic Info

{
"browser-info": {
"language": "en-US",
"platform": "Linux x86_64",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.7+10-post-Ubuntu-2ubuntu218.04",
"java.vendor": "Ubuntu",
"java.vendor.url": "https://ubuntu.com/",
"java.version": "11.0.7",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.7+10-post-Ubuntu-2ubuntu218.04",
"os.name": "Linux",
"os.version": "4.15.0-96-generic",
"user.language": "en",
"user.timezone": "Etc/UTC"
},
"metabase-info": {
"databases": [
"postgres"
],
"hosting-env": "unknown",
"application-database": "h2",
"application-database-details": {
"database": {
"name": "H2",
"version": "1.4.197 (2018-03-18)"
},
"jdbc-driver": {
"name": "H2 JDBC Driver",
"version": "1.4.197 (2018-03-18)"
}
},
"run-mode": "prod",
"version": {
"date": "2020-07-21",
"tag": "v0.36.0",
"branch": "release-0.36.x",
"hash": "b31049f"
},
"settings": {
"report-timezone": "America/Sao_Paulo"
}
}
}

My problem!!(I will put some screenshots)

I'm trying to get the percentage of rows who have certain value. I didn't find a way to do this using only the gui and considering the insertion of the variable value is optional, I think that using only the gui it is not possible to do that.


My variable is configured as a filter field and mapped to field customer if the same table i'm using to calculate the percentage.

So, this way the dropdown filter widget Customer show me the list of customers. But when i try to use the filter this error appears.

I've tried to cast the filter to character varying, and "works", but not properly.

Sorry by the amount of prints. If you have any idea what I'm doing wrong, please tell me about it.

Hi @johhen

You cannot use Field Filters like that - read this:
https://www.metabase.com/blog/field-filters/index.html

Upgrade to latest release 0.36.4

And then migrate away from H2:
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html

1 Like

thank you, https://www.metabase.com/blog/field-filters/index.html works for me…