Can tables within the same schema become a filter?

jchan
New Member

There are many tables in our database having the same structure, and all of them need to add some customized measures.
 

For example, the tables named test1, test2, … test50.
These tables all have columns [ id, name, contract, earnings...] , and I need to create some frequently-used sql query as measures like [total_earnings, investment_count, ...] in each view.
 

However, it’s inefficient for me to keep adding identical dimensions/measures after the new table/view generated. I’ve tried using a parameter to filter different tables, so that I could use only one view:

derived_table: {
sql:
select * from schema.{% parameter tables %}
;;
}

parameter: tables {
type: string
}

But the variable `tables` return not found in the query, I’m wondering how could I modify this or maybe there’s a better approach?  

Many thanks!

0 3 266
3 REPLIES 3
Top Labels in this Space
Top Solution Authors