Filtering of schemas

I have a use case where we have multiple schemas in a connection. Each schema contains views that are the same. I have created a user attribute that has the value of one of the schemas, however I need to make the schemas dynamic so a user can select a schema. Here is what I have:

view: page_sessions {

sql_table_name: {{ _user_attributes[‘custom_schema’]}}.page_sessions_view ;;

Right now the user attribute ‘custom_schema’ has one value. I want to enable filtering so that a user can select whatever schema that they choose.

0 4 246
4 REPLIES 4

Hey Shawn! Welcome to the community 🙂

You can do that using parameters instead of user attributes with this syntax:

sql_table_name: {% parameter schemaname %}.page_sessions_view ;;

This help article will help you!

Thanks @Cyril_MTL_Analy! I will try that.

Did that help @Shawn_Crenshaw?

Yes, it did. Thanks for your help.

Top Labels in this Space
Top Solution Authors