You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Thoufiqkhan (via GitHub)" <gi...@apache.org> on 2024/09/20 08:05:13 UTC

[I] Cross-filter between two tables and its dimensions [superset]

Thoufiqkhan opened a new issue, #30345:
URL: https://github.com/apache/superset/issues/30345

   ### Bug description
   
   We are unable to control cross-filtering between two dimensions in two different charts. While cross-filtering is enabled for both charts, not all dimensions should be cross-filterable. In Apache Superset, all dimensions are clickable and will affect the tables where cross-filtering is enabled.
   
   For example, in the screenshot, the "Provider Snapshot" and "Top 10 Codes by Provider" charts have cross-filtering enabled. I want to allow cross-filtering only when clicking on the "Full Name" dimension. Currently, clicking on "Provider Specialty" also causes cross-filtering in the second table, which should not occur.
   
   ### How to reproduce the bug
   
   To reproduce this bug, follow these steps:
   
   - Create two charts, each with multiple dimensions.
   
   - Enable cross-filtering between the charts.
   
   - Ensure that both charts’ datasets have the same column names to effectively enable cross-filtering.
   
   -Click on dimensions other than the intended one.
   
   You will notice that the second chart is loading due to cross-filtering, which is not the desired behavior.
   
   ### Screenshots/recordings
   
   ![Cross-filter SS](https://github.com/user-attachments/assets/a253bf85-d27f-40af-97eb-eccf221ae71e)
   
   
   ### Superset version
   
   3.1.3
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### 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.
   - [X] 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Cross-filter between two tables and its dimensions [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #30345:
URL: https://github.com/apache/superset/issues/30345#issuecomment-2802518302

   This issue has gone silent for more than 200 days, so we're assuming it's no longer relevant, since no others have chimed in.
   
   We also no longer support Superset 3.x. 
   
   I'll close it as not-planned for the above reasons, but if you're still facing this in current versions, we can revisit/reopen, no problem!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Cross-filter between two tables and its dimensions [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #30345: Cross-filter between two tables and its dimensions
URL: https://github.com/apache/superset/issues/30345


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Cross-filter between two tables and its dimensions [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #30345:
URL: https://github.com/apache/superset/issues/30345#issuecomment-2363102807

   <!-- Answer -->
   To control cross-filtering between two dimensions in different charts in Apache Superset and ensure that only specific dimensions, like "Full Name," trigger cross-filtering, you can use the cross-filtering configuration available in the Superset dashboard utilities.
   
   Here is an example of how you can configure cross-filtering to enable it only for the "Full Name" dimension:
   
   ```ts
   import { getCrossFiltersConfiguration } from 'src/dashboard/util/crossFilters';
   import { FeatureFlag, isFeatureEnabled } from '@superset-ui/core';
   
   const dashboardLayout = {}; // Your dashboard layout configuration
   const metadata = {
     chart_configuration: {
       1: { // Replace with your chart ID
         crossFilters: {
           scope: {
             charts: [1], // Specify the chart IDs
             columns: ['Full Name'], // Specify the dimensions that should trigger cross-filtering
           },
         },
       },
     },
     global_chart_configuration: {
       scope: {
         charts: [1], // Specify the chart IDs
         columns: ['Full Name'], // Specify the dimensions that should trigger cross-filtering
       },
     },
   };
   const charts = {}; // Your charts state
   
   if (isFeatureEnabled(FeatureFlag.DashboardCrossFilters)) {
     const crossFiltersConfig = getCrossFiltersConfiguration(dashboardLayout, metadata, charts);
     console.log(crossFiltersConfig);
   }
   ```
   
   In this example, the `getCrossFiltersConfiguration` function is used to specify that only the "Full Name" dimension should trigger cross-filtering. The `metadata` object defines the charts and columns that are included in the cross-filtering scope. The `dashboardLayout` and `charts` objects represent your dashboard layout and charts state, respectively. The `isFeatureEnabled` function checks if the cross-filtering feature is enabled <sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/src/dashboard/util/crossFilters.ts)</sup>.
   
   Additionally, you might find these similar discussions helpful:
   1. [Cross filter in bar chart by x-axis field, not by dimension](https://github.com/apache/superset/discussions/29489) <sup>[[2]](https://github.com/apache/superset/discussions/29489)</sup>.
   2. [Superset Dashboard Cross Filtering on Selected Columns](https://github.com/apache/superset/discussions/23412) <sup>[[3]](https://github.com/apache/superset/discussions/23412)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org