Use query parameter value in widget title

Not sure how to achieve this, but I have a widget with a parameter, and the title of the visualisation should depend on the value of this parameter. Example, sales for breadsticks versus sales for bretzels.

The query looks something like

select sum(sales_value) from transactions where category = {{ type }}

where type can be either breadsticks or bretzels

Now, this query would be used in two distinct widgets in a dashboard, one for each breadsticks/bretzels category. One widget with type=breadsticks, and another widget with type=bretzels.

The problem is: each widget should have its own title (e.g. Breadstick sales and Bretzel sales) but I can’t find how to customise the title of a widget in the dashboard. It systematically takes the title of the visualisation which is used, at the query level. And it seems that visualisation titles won’t work with parameters.

Obviously, the visualisation (at the query level) cannot be aware of the parameter’s value at this stage.

How to use the same query with a parameter, and make the dashboard’s widget title reflect this?

Duplicate of a few other threads:

Related issue: https://github.com/getredash/redash/issues/4383

Somewhat related as both of these would be implemented at the same time:

Yep, agreed. Thanks for mentioning.

1 Like