Hello,
Please refer to this example Metabase structure:
MetabaseInstance:
..|..dash_directory:
..|....|..actual_dashaboard:
..|....|....|..table_1
..|....|..queries_directory:
..|....|....|..table_1
..|....|....|..subquery_directory:
..|....|....|....|..subquery_for_table_1
..|..staging_models:
..|....|..model_1
In this example, table_1 references subquery_for_table_1 and that references model_1. The job of model_1 is to standardize and aggregate data for many reports. The job of subquery_for_table_1 is to tailor the data for the dashboard. Finally, table_1 is responsible for all visualization / formatting aspects to make the report nice and pretty.
In this example, lets say I have a optional clause variable in the SQL query subquery_for_table_1. The widget or what-have-you exists inside the dashboard though. So the variable would need to be supplied to table_1 and be persisted to subquery_for_table_1 where it can be applied to the query.
Is there any way to persist variables through charts this way?
Edit:
By "variable", I mean subquery_for_table_1 is customized in the following way:
SELECT count(*)
FROM products
WHERE true
[[AND id = {{id}}]]
[[AND {{category}}]]