Dear GCCommunity,
I have an issue, tried to solve myself or find on the web -> unfortunately without a result.
Here is the problem:
I have 2 tables, see template below:
Citizen (Id) - Associated Zip code ;
Zip code - City;
On the looker dashboard i link those 2 tables and add 2 filters on Zip and on City.
The second filter on City is linked to Zip, and i know that it is always a unique value per Zip.
I would like to filter my table on the City filter, Zip filter is not connected to the Table.
Potentially i see 2 solutions:
1. Autopopulate City filter based on the chosen Zip code.
2. Add a filter in the definition of the views/explore, perhaps via using parameters, to query first second Table (zip-city) and get as response the associated City.
Could you please advise me?
################################
Here would be BQ data:
sql_table_name: `XXX.citizen-city`;;
dimension: id {
type: number
description: "Citizen ID"
sql: ${TABLE}.id;;
}
dimension: zip {
type: string
description: "Zip code, citizen belongs to"
sql: ${TABLE}.zip;;
}
}
view: zip_city {
sql_table_name: `XXX.zip-city`;;
dimension: zip {
type: string
description: "Zip code of part of a city"
sql: ${TABLE}.zip;;
}
dimension: city {
type: string
description: "City, zip belongs to"
sql: ${TABLE}.city;;
}
}
######## Explore########
explore: test_citizen_zip_city {
from: citizen_zip
label: "Test View"
join: zip_city {
relationship:many_to_one
sql_on: ${test_citizen_zip_city.zip} = ${zip_city.zip} ;;
}
}