How to use filters as use id but show names?

so , what i want is add filter as id but show name so that user can identity better -

for eg there are two tables organizations and members , organizations has id ,and name and members has org.id and member details so my query goes like this

select count(1) from members where {{org_name}}

and in admin →tablemetadata → members i changed the org id to fk and mapped it to organzations id → list all values , everywhere and in display values i changed it to fk and organizations .‘name’

then in query i cahnged the filtere to field filter and mapped it to members.org_id but in filter its showing ‘1-1’, ’2-2’, ’3-3’ not org names

what am i doing wrong ?

Make sure you have organizations.name set as an Entity Name type in Table Metadata.

It sounds like your foreign key is set up wrong, it should link members.org_id and organizations.id. If set up correctly, Metabase will understand the transitive relationship and pull organizations.name when it sees members.org_id.

Finally your query filter should use members.id as a linked field.

1 Like