Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens] Support drilldowns in charts with only one dimension (when it is a formula) #151726

Closed
Tracked by #184459
drewdaemon opened this issue Feb 21, 2023 · 11 comments
Closed
Tracked by #184459
Labels
enhancement New value added to drive a business result Feature:Lens 🧊 iceboxed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@drewdaemon
Copy link
Contributor

drewdaemon commented Feb 21, 2023

If I have a chart with only one dimension (metric) which is a formula then the drilldowns are not applied.

We could possibly allow them but then there is the question on which filters should be applied:

  • If I have something like func(field) then it can create a field: exists filter
  • If I have something like func(field1) + func(field2) ? Could be 2 filters with field1: exists and field2: exists but does it make sense?
@drewdaemon drewdaemon added loe:medium Medium Level of Effort Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. labels Feb 21, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

@stratoula
Copy link
Contributor

@drewdaemon they are supported

lens

Am I missing something?

@stratoula
Copy link
Contributor

The problem is not general but only if formulas are applied (it works fine with quick functions)

@drewdaemon drewdaemon changed the title [Lens] Support drilldowns in new metric [Lens] Support drilldowns in metric with formula Feb 23, 2023
@drewdaemon drewdaemon added the bug Fixes for quality problems that affect the customer experience label Feb 23, 2023
@stratoula
Copy link
Contributor

I checked this issue and it happens for the following reason:

  1. Formula creates 2 columns
    • (Part of which if I understand correctly is hidden and has configuration that is important for the visible column
    • The visible column

The look like that

``` [ { "id": "c0df5a54-b17a-475c-8dde-8da22af9c696X0", "name": "Part of min(AvgTicketPrice)", "meta": { "type": "number", "field": "AvgTicketPrice", "index": "kibana_sample_data_flights", "params": { "id": "number", "params": { "pattern": "$0,0.[00]" } }, "source": "esaggs", "sourceParams": { "hasPrecisionError": false, "indexPatternId": "d3d7af60-4c81-11e8-b3d7-01146121b73d", "id": "0", "enabled": true, "type": "min", "params": { "field": "AvgTicketPrice" }, "schema": "metric" } } }, { "id": "c0df5a54-b17a-475c-8dde-8da22af9c696", "name": "min(AvgTicketPrice)", "meta": { "type": "number", "params": { "id": "number" } } } ] ```

When we are checking if a filter is compatible to create a drilldown we are using the visible column (this makes sense to me) and the reason it returns incompatible is simply because it fails here https://github.com/elastic/kibana/blob/main/src/plugins/data/public/actions/filters/create_filters_from_value_click.ts#L84

The Part of column has this information, so I wonder which is the best approach here. Why the visible column doesnt have this information? Should we pass it from the partial column to the visible one or should we create the filter from the partial column?

@dej611 you know formulas better than me. Can you take a look?

@stratoula
Copy link
Contributor

stratoula commented Apr 3, 2023

Another update on this:

  • metrics with formula and drilldown work fine.
  • if I have a formula like that min(field1) - min(field2) which filter should be created?

The same behavior exists if I have a bar chart with a formula (and no x-axis/split dimension)

I am changing to an enhancement.

@stratoula stratoula added enhancement New value added to drive a business result impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. and removed bug Fixes for quality problems that affect the customer experience impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. labels Apr 3, 2023
@stratoula stratoula changed the title [Lens] Support drilldowns in metric with formula [Lens] Support drilldowns in charts with only one dimension (metric formula) Apr 3, 2023
@stratoula stratoula removed the loe:medium Medium Level of Effort label Apr 3, 2023
@timductive timductive added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. and removed impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels Apr 5, 2023
@ninoslavmiskovic
Copy link
Contributor

ninoslavmiskovic commented May 11, 2023

hi @drewdaemon and @stratoula ,

I had some time to check this out on the 8.9 version (see recording):

Skaermoptagelse.2023-05-11.kl.21.36.06.mov

I want to make sure I understand this 💯 , so apologies for going into too many details perhaps 😃

I have two metric visualizations both of them with exactly the same drill-downs.

  • One with "Quick function"
  • One with formula

The one with formula is not working with drill-down as mentioned by both of you above ⬆️

My take from the user perspective is that the drill-down should behave the same way regardless of how the calculation is done (formula or quick function). Currently, the user does not get any information why the drill-down he/she just setup on a metric with formula is not working

@stratoula : Could you perhaps elaborate on this: "metrics with formula and dropdowns work fine." Do you mean metric with quick functions?

WDYT ?

@stratoula
Copy link
Contributor

@ninoslavmiskovic

  1. I had a typo, metrics with formulas and drilldowns work fine. What doesnt work are metrics with math i.e. min(field) + max(field).
  2. When we say metric we mean the metric dimension not the chart :)

@ninoslavmiskovic
Copy link
Contributor

@stratoula

Thanks 🙏 I was looking at this late last night. With your explanation and a read, it makes more sense. 😊

  • I removed the suggestion for the title change.

I still think it would make sense to support:

  • When a user writes a formula like func(field) we should create an existing filter like @drewdaemon suggests.

For metrics with math i.e. min(field) + max(field). :

  • Would it make sense to display the formula query on a panel with a filter icon, as we do with ESQL charts on a dashboard, and perhaps write some information that the drill-down filter is not applicable?
  • I recommend that we involve UX, because we have the same challenge with Lens suggestions created with ESQL (eval).

@stratoula
Copy link
Contributor

@ninoslavmiskovic
Copy link
Contributor

I am okay with the approach of hiding the drill-downs that are incompatible.

FWIW I was referring to this icon that we already use (ESQL), which perhaps we could also use to display formula queries. This way the user does not have to go to Lens to figure out the formula query. (Perhaps this could be a separate enhancement request)

Skærmbillede 2023-05-12 kl  11 57 31

@drewdaemon drewdaemon changed the title [Lens] Support drilldowns in charts with only one dimension (metric formula) [Lens] Support drilldowns in charts with only one dimension (when it is metric formula) Sep 26, 2023
@drewdaemon drewdaemon changed the title [Lens] Support drilldowns in charts with only one dimension (when it is metric formula) [Lens] Support drilldowns in charts with only one dimension (when it is a formula) Sep 26, 2023
@markov00
Copy link
Member

markov00 commented Jun 3, 2024

In order to provide better transparency of priorities, issues that will not be prioritized within the next 24 months are being closed.

Tracking request in Lens general improvements ice box #184459

@markov00 markov00 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens 🧊 iceboxed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

6 participants