-
In Metabase, I created a foreign key relationship between a Students table and a Schools table. In the MySQL database, both these tables are actually views derived from the same Users table, with a self-joined foreign key between Parent ID and User ID.
-
In the Students table, I remapped the School ID field to display the school name from the foreign key relationship, instead of displaying the ID.
-
As you can see in the following screenshot, this worked fine:
- Next, I created a question based on the Placements table, which has a foreign key relationship with Students. The question is supposed to display the number of placements, grouped by school. I selected the same Students->School field as the group by, but as you can see in the following screenshot, it's grouping by the School ID, not the school name.
Since the School field was remapped to lookup the school's name, I don't understand why this question is grouping by the school ID instead of its name.
{
"browser-info": {
"language": "en-US",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4309.0 Safari/537.36 Edg/88.0.698.0",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.9+11",
"java.vendor": "AdoptOpenJDK",
"java.vendor.url": "https://adoptopenjdk.net/",
"java.version": "11.0.9",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.9+11",
"os.name": "Linux",
"os.version": "5.4.0-1018-aws",
"user.language": "en",
"user.timezone": "America/New_York"
},
"metabase-info": {
"databases": [
"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": "2020-10-26",
"tag": "v0.37.0.2",
"branch": "release-x.37.x",
"hash": "ba7be09"
},
"settings": {
"report-timezone": "US/Eastern"
}
}
}