EBoisseauSierra opened a new issue, #19644: URL: https://github.com/apache/superset/issues/19644
## The problem I have I would like to combine a dataset's Saved Metrics to compute new ones and stay DRY. But it's currently not possible. ## The solution I'd like Say I'm tracking my widget production, and record for each batch how many items have been produced and how long it took. I can then define at the Dataset level the following Saved Metrics: * `SUM(quantity) AS production`, and * `SUM(duration) AS work_hours`. Imagine I'd now like to plot productivity over time: I would love to go to the Explore Panel, create a line chart which Metric would be `production / work_hours`. However, this is currently only possible with Calculated Columns, not Saved Metrics. I could also want to be able to define `productivity` as a new Saved Metric (but I understand this might be trickier, due to definitions dependencies resolution). ## Some possible (sub-optimal) alternatives It is obviously possible to define the `productivity` KPI as `SUM(quantity) / SUM(duration)` — either as a new Saved Metric or Custom SQL. But this isn't DRY, what causes some issues should I want to change, say, how I compute `work_hours` (two Saved Metrics definition to change), or if my Saved Metrics are a bit convoluted (risk of errors in copy-pasta). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
