Skip to content

Filter with multiple values doesn't return correct data #33221

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

Open
2 of 3 tasks
personofnorank opened this issue Apr 23, 2025 · 3 comments
Open
2 of 3 tasks

Filter with multiple values doesn't return correct data #33221

personofnorank opened this issue Apr 23, 2025 · 3 comments
Labels
dashboard:filtersets Related to the filtersets of the Dashboard

Comments

@personofnorank
Copy link
Contributor

personofnorank commented Apr 23, 2025

Bug description

Bug: I have a dashboard consisting of a table with a filter on one of the columns. The filter allows multiple values. A particular row appears in the chart when I only add one value to the filter, but if I add two values the row disappears from the chart although one of them is the right value for the row.

Expected behavior: a filter that allows multiple values would return all rows that match one or more of the values selected.

To reproduce: this may depend on your data as I haven't observed this behavior consistently and I'm not clear what types of data would trigger the issue.

  1. Create a table chart.
  2. Add the chart to a dashboard.
  3. Add a filter on one of the rows in the table, and set it to allow multiple values.
  4. Select one value in the filter and observe what data is returned.
  5. Add another value to the filter. All the data previously returned should still be returned, plus any data matching the additional filter value. But in my case some of the data previously returned disappears.

I can't share a screenshot as my data is customer-sensitive. I gather from kapa.ai that this is a known issue but I wasn't able to find a specific issue on Github - apologies if I missed one.

My company is using Superset 3.1.3 but kapa.ai tells me this may occur with newer versions too. If that's wrong and this is known to be fixed in later versions, please let me know as it will help make a case for upgrading.

Screenshots/recordings

No response

Superset version

3.1.3

Python version

3.9

Node version

16

Browser

Firefox

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@dosubot dosubot bot added the dashboard:filtersets Related to the filtersets of the Dashboard label Apr 23, 2025
Copy link

dosubot bot commented Apr 23, 2025

Hello @personofnorank! I'm Dosu, a bot here to help you solve bugs, answer questions, and guide you on becoming a contributor. I'll assist you while you wait for a human maintainer to take a look at your issue. How can I assist you today?

The issue you're experiencing with the filter not returning the correct data when multiple values are selected might be related to how Superset handles multiple value filters. Superset uses the IN operator to include all selected values in the filter criteria. If a row disappears when you add a second value, it could be due to how the filter is applied or possibly an issue with the data itself.

Here are a few things to consider:

  1. Filter Logic: Ensure that the filter logic is correctly set to use the IN operator, which should include all rows that match any of the selected values. This is the expected behavior in Superset [1].

  2. Data Consistency: Check if there are any inconsistencies or special conditions in your data that might affect the filter's behavior. Sometimes, data types or unexpected null values can cause filters to behave unexpectedly.

  3. Version Compatibility: While I couldn't find specific known issues or fixes related to this problem in the latest versions, it's possible that upgrading might resolve the issue if it was addressed in a newer release. However, without specific release notes or documentation indicating a fix, this is not guaranteed.

  4. Default Settings: Review the default filter settings in your Superset configuration to ensure they align with your expectations, such as allowing multiple selections and using the correct operators [2].

If these suggestions don't resolve the issue, it might be helpful to test with a simplified dataset to isolate the problem or consult any recent changes in the Superset codebase that might affect filter functionality.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@rusackas rusackas added the review:checkpoint Last PR reviewed during the daily review standup label Apr 23, 2025
@rusackas
Copy link
Member

Is it possible to give us repro steps using a built-in example dashboard? That would make it far easier to troubleshoot.

@personofnorank
Copy link
Contributor Author

@rusackas I'll try. The issue doesn't always happen - only saw it today - so I assume there is some unusual scenario to do with the data or the underlying query.

@rusackas rusackas removed the review:checkpoint Last PR reviewed during the daily review standup label Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard:filtersets Related to the filtersets of the Dashboard
Projects
None yet
Development

No branches or pull requests

2 participants