getredash / redash

Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data.
http://redash.io/
BSD 2-Clause "Simplified" License
26.36k stars 4.37k forks source link

Use parameter values in query title #4383

Open arikfr opened 4 years ago

arikfr commented 4 years ago

Given a query with parameter {{x}} if the title has {{x}} in it, it will be replaced with the parameter value. If no value is provided, the parameter name will be shown (?).

susodapop commented 4 years ago

I wanted to clarify: is this for the Query Title shown on a dashboard? Or for the query Name shown in the list view and when searching for queries while making an Alert, for example?

JivanRoquet commented 4 years ago

I second @arikfr point here. Without this capability, parameters are basically useless in practice.

@susodapop if your in-progress React implementation leaves you any spare time to work on stuff that delivers actual value to your users (aside from deleting users' posts in your Discourse support channel), this one is a must-have.

Or, as an alternative, at least there needs to be a way to change a dashboard widget title. Without at least one of these solutions, we can't use parameters in queries that are intended for a dashboard (because the title won't be able to reflect them).

arikfr commented 4 years ago

We always try to balance between long term value projects like React migration or the Python 3 support and user facing features. While we would love to do only the later, for the long term maintainability of the project, we have to invest in less user facing projects too.

While this specific feature is very important to your use case, it's actually not that common of a request and this is why it wasn't implemented so far.

If you're interested to submit a pull request implementing this, let me know, and we can discuss possible implementation.

Lastly, I don't see any deleted posts in Discourse: what are you referring to?

JivanRoquet commented 4 years ago

Hello @arikfr thanks for the quick answer. I was saying the above because of a number of reasons:

Keep it up, but in my case I'm only using Redash because I don't have a choice. As soon as I get an access to the underlying db, I'll use a different solution. Software is just too limited as of today (one can't even customise the title of a widget, c'mon... I'm not even talking about the dashboard "text box" widget which is closer to a joke than to a feature)

cloudjesper commented 4 years ago

I second @JivanRoquet . I'm new to reDash and within the first couple of hours of trying it out, I wondered why the query name cannot be overwritten when adding it to a dashboard. This is more important than making a parameter available as the query title, since many cases could exist where you would filter data on a code or multiple values, but would like to give the visualization a nice name. Also it would mean only having one version of a query to maintain instead of having multiple copies of a query with just the name of it changed. So being able to overwrite the widget name would give great value.

ashishsingal1 commented 3 years ago

Strong use case for me as well. I'm having to replicate queries over and over just to change the title for dashboards. Even an option where the query title can be overwritten on the widget level would suffice here.

sylvestre commented 3 years ago

Not sure it is exactly what was requested but now, with the Edit Source and "Value/Static value" (in Edit Parameters) image I am getting what I wanted!

m-hiki commented 3 years ago

If the same queries of different parameters are used in dashboard, they can't be distinguished what the parameter is used. スクリーンショット 2021-10-29 18 14 59

I think this proposal resolve my problem.

ofirz commented 2 years ago

Having the same problem, @m-hiki illustrates this very well!

akhilpratap1991 commented 1 year ago

Just started using redash and ran into same problem. I had to replicate one query into 4 different queries with different param value so that dashboard shows different name/title. Maybe adding a widget name that overrides query title in dashboard will help. Using widget name along with static param value will solve this for me.

shaymandel commented 1 year ago

+1 that this is an important feature to have. Especially for dashboards that use the same query a few times, and also for dashboards where there is an overview query shows a summary query (e.g. bar chart with build times for each service) and drill-down queries, filtered for a specific service.

dadwin commented 1 year ago

@m-hiki provided the great example, thank you! I have the same cases, and would appreciate changes.

I have some workarounds though:

  1. if you have a small set of charts (~10), you add several identical charts for the query, and name charts with different names. E.g. I have aggregation query and, i'd like to show daily, weekly and monthly aggregation, so I have three chart/visualisation for the query named: Daily, Weekly, Monthly, so on the dashboard I can tell which one is what.

  2. sometimes you cannot follow 1st approach because chart title can be any string/number. Here I add parameter as prefix for column which is used in grouping. Then chart legend shows me parameter and I can tell which chart is that, see the screenshot. The disadvantage here - colors assigned automatically, so they all be different across charts.

so it's not perfect but help survive 😎

image