Parametrized queries
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, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access