# Load filter suggestions for dynamic sql\_table\_name

**URL:** <https://discuss.google.dev/t/load-filter-suggestions-for-dynamic-sql-table-name/116223>\
**Category:** Looker\
**Tags:** lookml, filter\
**Created:** [February 17, 2023, 5:23pm UTC](https://discuss.google.dev/t/load-filter-suggestions-for-dynamic-sql-table-name/116223 "2023-02-17T17:23:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous8](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@anonymous8](https://discuss.google.dev/u/anonymous8)\
**Post date:** [February 17, 2023, 5:23pm UTC](https://discuss.google.dev/t/load-filter-suggestions-for-dynamic-sql-table-name/116223/1 "2023-02-17T17:23:09Z")

</div>

Hello All,

I have a scenario where I need to pick a database/schema for a table based on a user selection

below are the example lookml views and explore definitions

view: db\_selector {  
parameter: db {  
type: unquoted  
allowed\_value: {label: “Database 1” value: “x\_schema”}  
allowed\_value: {label: “Database 2” value: “y\_schema”}  
default\_value: “x\_schema”  
}  
}

view: table\_a {  
sql\_table\_name: {% if db\_selector.db.\_parameter\_value==“x\_schema” %}“x\_schema”{% elsif db\_selector.db.\_parameter\_value==“y\_schema” %}“y\_schema”{% else %} “x\_schema”{% endif %}.table\_a ;;

dimension: location\_city {  
type: string  
description: “City Name”  
sql: ${TABLE}.city ;;  
}  
}

explore: table\_a {  
always\_join: [db\_selector]  
description: “This view has one row per location”  
always\_filter: {  
filters: [db\_selector.db: “y\_schema”]  
}  
join: db\_selector {}  
}

Everything works fine at look/query sql except for filter suggestions. The filter suggestions always fetch suggestion from “x\_schema” (or default schema) even when “y\_schema” is picked by the user

Is there a way to get around it ? Thanks in advance
