elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.5k stars 8.05k forks source link

[Lens] layer setting "Use global filters" does not respect local filters set directly on the Lens object #184100

Open jtkarb opened 1 month ago

jtkarb commented 1 month ago

Kibana version: 8.11.3, 8.12.1

Describe the bug: When "Use global filters" is toggled OFF in the layer settings of a Lens visualization, local filtering (via filter buttons or search bar) on the Lens object is not respected. The expectation is for the "Use global filters" toggle to ignore dashboard-level (global) filtering but still apply local filters set on the Lens object itself.

Expected behavior: With "Use global filters" OFF, dashboard-level filters should be ignored, but local filters in the Lens visualization should be applied.

Steps to reproduce:

  1. Create an empty dashboard.
  2. Create a Lens visualization:
    • Turn off "Use global filters" in layer settings.
    • Add a local filter on a data field (e.g., a field used for X-axis buckets).
    • Save the Lens visualization to the dashboard.
  3. On the dashboard, add some filters (using filter buttons, search bar, or controls).
  4. Observe that the Lens visualization ignores the local filter set during creation.

Screenshots: This screenshot illustrates the problem using the data from "Kibana Sample Data Flights": Disregarding-global-filters-also-disregards-local-filtering-on-lens-objects-v2

Summary:

elasticmachine commented 1 month ago

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

teresaalvarezsoler commented 1 month ago

hey @jtkarb I understand your issue with this setting, but can I ask why you need to ignore the global settings at the dashboard level in first place? There can be other solutions rather than using the Ignore global filters that I can recommend if I better understand what your use case is.

jtkarb commented 3 weeks ago

Hi @teresaalvarezsoler - We need the ability to selectively apply controls to specific visualizations on our dashboard. For instance, consider a benchmarking dashboard that compares the performance metrics of various sites.

We want the top chart to display overall benchmarking performance across all sites, while the charts below should show data for individual sites based on the current site selected in Controls. The Controls should filter the individual site visualizations without affecting the overall benchmarking chart at the top.

This functionality is crucial because if the top benchmarking chart is affected by the controls, it will only display data for the selected site, which is not our intention.

Regardless of our use case, we still believe that the Ignore global filters setting does not currently work as intended.

teresaalvarezsoler commented 3 weeks ago

Thanks @jtkarb, I guess something like this https://github.com/elastic/kibana/issues/29749 would better fit your needs. We have this in the roadmap but unfortunately, we don't have any dates yet.

In the meantime, the only solution would be to build two different dashboards with different controls and link them together using the links panel (https://www.elastic.co/guide/en/kibana/current/dashboard-links.html) so the user can easily navigate from one to another and it will feel as if they were tabs of the same dashboard.