Not equals filter on length calculation not working

Hi

Quick Summary:
Not equal to filter does not seem to work on calculated field which is length of another field .

How to recreate with sample data:
I created a field based on the length of another field, in the sample database I chose to use people table and created name_length which was “=length([name])”
The result displays properly when I view it.
When I filter on this field the “not equals” does not do what is expected.
I filtered for name_length not equal to 12 and was surprised when my result set had name_length = 12 results.
If I ask for > 12 I get correct results, <12 also gets correct results, = also gives correct results.
Wasn’t sure what was going on so stopped the server and updated to latest and tried again and got the same result.

Our use case:
We currently use metabase as an internal tool for our consultants to produce reports and check customer data - we were trying to see if the customer had entered an incorrect identifier - the incorrect ones would have a length not equal to 10.

Thanks

Stephen

Here is my diagnostic info: (I am running the docker image in AWS behind nginx)
{
“browser-info”: {
“language”: “en-US”,
“platform”: “Linux x86_64”,
“userAgent”: “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0”,
“vendor”: “”
},
“system-info”: {
“file.encoding”: “UTF-8”,
“java.runtime.name”: “OpenJDK Runtime Environment”,
“java.runtime.version”: “11.0.10+9”,
“java.vendor”: “AdoptOpenJDK”,
“java.vendor.url”: “https://adoptopenjdk.net/”,
“java.version”: “11.0.10”,
“java.vm.name”: “OpenJDK 64-Bit Server VM”,
“java.vm.version”: “11.0.10+9”,
“os.name”: “Linux”,
“os.version”: “4.14.209-160.339.amzn2.x86_64”,
“user.language”: “en”,
“user.timezone”: “GMT”
},
“metabase-info”: {
“databases”: [
“h2”,
“mysql”
],
“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”: “2021-02-11”,
“tag”: “v0.37.9”,
“branch”: “release-x.37.x”,
“hash”: “a9a7fc8”
},
“settings”: {
“report-timezone”: “Australia/Sydney”
}
}
}

Hi @stephenh
That was annoying - I remember testing this back in 0.36.1, when we did some changes to filters and it worked, but stopped working even though I’m fairly sure we have a test for this.
Anyways - I have created an issue with more details, which will be closed, when there’s a test, so a regression like this doesn’t happen again. It will be fixed in 0.38.0 and I have listed a workaround.
https://github.com/metabase/metabase/issues/14843

Thanks for the super fast response. Look forward to it being fixed in the next release.

Confirmed working in 0.38.0
Thanks

1 Like