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

  • [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [x] 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.

Comment From: dosubot[bot]

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

Comment From: rusackas

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

Comment From: personofnorank

@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.

Comment From: personofnorank

@rusackas to reproduce with built-in dashboard: 1. Go to Video Games dashboard. 2. Add a filter on "platform", allowing multiple values. 3. Confirm that the "Top 10 Games Sales" chart includes platforms DC and GB. 4. Set the platform filter to DC and GB. 5. The chart shows only values for GB. I tested this using 4.1.2 (on my laptop as opposed to corporate instance which is 3.1.3).

Comment From: rusackas

Thank you for the reproducible example! It seems this has been fixed, so I'll close it out accordingly. Appreciate both the issue and the repro steps!

Image