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] layer setting "Use global filters" does not respect local filters set directly on the Lens object #184100

Open
jtkarb opened this issue May 23, 2024 · 5 comments
Labels
bug Fixes for quality problems that affect the customer experience Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@jtkarb
Copy link

jtkarb commented May 23, 2024

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

  • Top row uses global (dashboard) filtering.
  • Bottom row ignores global filtering.
  • Left side uses no local filtering on heatmaps.
  • Right side uses local filtering on the X-axis field.
  • The bottom right heatmap does not display expected results as the local filter is ignored.

Summary:

  • Bug: Local filters in Lens visualizations are ignored when "Use global filters" is OFF.
  • Expected: Local filters should be respected, while global filters are ignored.
  • Steps to Reproduce: Detailed above with an example using "Kibana Sample Data Flights."
  • Visual Evidence: Screenshots illustrating the issue.
@jtkarb jtkarb added the bug Fixes for quality problems that affect the customer experience label May 23, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label May 23, 2024
@dej611 dej611 added Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels May 29, 2024
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs-team Issues missing a team label label May 29, 2024
@jtkarb jtkarb changed the title Lens layer setting "Use global filters" does not respect local filters set directly on the Lens object [Lens] layer setting "Use global filters" does not respect local filters set directly on the Lens object Jun 4, 2024
@teresaalvarezsoler
Copy link

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.

@teresaalvarezsoler teresaalvarezsoler removed the bug Fixes for quality problems that affect the customer experience label Jun 17, 2024
@jtkarb
Copy link
Author

jtkarb commented Jun 25, 2024

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
Copy link

Thanks @jtkarb, I guess something like this #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.

@jtkarb
Copy link
Author

jtkarb commented Sep 30, 2024

I still find the current implementation of the "Use Global Filters" feature to be unintuitive. When it's set to "OFF," both dashboard-level and visualization-level filters are ignored. However, if the goal is to ignore filters within a specific visualization, it would be more straightforward to simply remove those filters from that visualization—there’s no need to add them in the first place if they serve no purpose.

For time filtering, you've introduced a "Custom Time Range" option in the panel settings, which allows users to apply a specific time filter to individual visualizations, overriding the dashboard's global time filter. This is a useful feature, and I’m essentially requesting a similar capability, but for any field other than @timestamp.

In other words, I’d like the ability to apply dashboard-level controls and filters without impacting specific visualizations where "Use Global Filters" is set to "OFF." However, I still need the filters applied directly to those visualizations to remain intact, as they are essential for accurate metric calculations. In many cases, we need to apply filters within a specific chart to ensure metrics are calculated correctly.

In summary, I'm asking for an option to create visualization objects that can calculate metrics accurately, independent of the dashboard-level filters.

@markov00 markov00 added the bug Fixes for quality problems that affect the customer experience label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

5 participants