When there is a need to dynamically provide conditions (or any predicates, in fact) to the query, without having to rewrite it every time the conditions change, you know that you need query parameters.
Every query can be parametrized, and as we have already seen in filters, there is a convention for this.
Starting Redash v5, there are two ways to add a parameter to your query.
Either you add a keyword that is enclosed in double curly braces, for example, {{param_name}} to your query, and it will automatically introduce a parameter (exactly the same way as it was before v5 release).
Alternatively, you can click on the Add New Parameter button (shortcut Cmd / Ctrl + P).
Once Redash recognizes that you've added a parameter, a special param box will appear in the query editor:
For example, in the preceding query, a parameter named '{{ds_name}}&apos...