Is it possible to use foreign key mapping and remapping for SQL queries?

Hi Folks,

We just upgraded to v0.25, and I’ve begun to dig into some of the new features. In particular, the remapping feature would be pretty handy to use from the UI rather than having to create custom bridge tables within the query. The drill through feature also looks pretty nifty. I see that these features are available within the query wizard, but they don’t appear to be active for SQL based questions.

Is it possible to utilize these features for SQL based questions?


I see there never came an answer on this question.
Would somebody know if this would be possible in someway?

@cobalt Yes, it’s possible - you would just have to write it manually, since Metabase currently cannot parse SQL, so it wouldn’t be able to inject remapping into your SQL code.
If you want to have this functionality in Metabase, then you can create database Views with your SQL code, so Metabase just sees that as a regular table and will give you all the remapping, drill-through and more.

Hi @flamber,

Thanks for your suggestion.
The only thing why that would not work for me, is because i want to force the user to set a filter.
I can do this with an SQL question, but not with a normal question. (unless i’m missing something).
But now I know there is no solution for this combination.

@cobalt So you currently cannot set a required filter in the QB questions - you are able to set default filter on the dashboard. Sounds like you’re looking for this issue: - upvote by clicking :+1: on the first post

Link seems broken?

@cobalt No, Github is broken right now, even though they say everything is fine :man_shrugging: