Skip to main content

We have 2 data sources, one containing polygons and the other containing lines. Because they are mostly independent, each has their own data source and they are blended on a subset of fields that they have in common (using "Data/Edit Blend Relationships"). Then they are both shown on a map using Tableau's map layers.

 

We're facing 2 issues with this setup:

1) colours are not shared between those fields that are blended together.

2) action filters in dashboards create 2 separate filters, one for each data source, making it impossible to have a single drop-down menu that's in agreement with the action filter.

 

Attached is a sample workbook to illustrate the setup and the 2 problems above.

 

1) In the sheet "colour issue" it's visible how the fields "Company" and "Operator" (which are blended together) have different and conflicting colour schemes (the common value "B" get's a different colour).

 

2) In the dashboard "filter issue" there are 2 sheets, one containing counties and one containing the lines & polygons. The idea is that on the left-hand map you can select a county, which then acts as an action filter on the right-hand map. There are 2 problems with this dashboard:

 

  • The counties on the left are not all the counties, only those that contain lines.
  • For reasons that are not obvious in this stripped down sample workbook we need to have the action-filter also as a 'drop-down' menu, so that we can control the county via either clicking on the left-hand map or using the drop-down menu. With one datasource this is possible (note how "Action county filter (lines)" is in 1-1 agreement with the action filter) but with 2 data sources we see no way how to achieve it. Note: in the dashboard you can see 3 drop-down menus: one for a county filter that acts on both data sources (doesn't respond to the action filter), the other 2 are those corresponding to the action filter (separated by data source)

 

Any thoughts or ideas on how to tackle these issues in Tableau would be much appreciated!

6 answers
  1. Jan 30, 2023, 3:19 PM

    Hi @Joey van der Leer Duran​ ,

     

    These were great questions and prompted me to re-think how the merged fields were constructed in order to get the desired results. I'll answer your questions in reverse order.

     

    2) In the solution I provided you can add the desired filter(s) to context (right-click on the filter field and choose "Add to Context") and then on each Set control set that to use "All Values in Context":

    Hi @Joey van der Leer Duran​ , These were great questions and prompted me to re-think how the merged fields were constructed in order to get the desired results. 

    1) The ZZZZ option is there because the data has been unioned (to get the single list of values for filters like the county filters & color legends) and we're using that unioned data as the source of values for the set. What I'd initially been thinking was about methods that rearrange the data source to have a separate list of values that would add complexity to the data prep and possibly performance issues. And then I thought about that IFNULL() statement for the merged attributes and came up with this:

     

    image 

    I've updated both merged attributes to use this formula so there aren't any ZZZZ's in the sets, put the Merged Co./Operator filter onto context, and then made both the Set controls aware of the context. So when B gets filtered out the Merged polygons-only attribute Set now only shows Circle & Pentagon.

     

    How this works for not displaying the ZZZZ is that since the ZZZZ value in the set is being ignored by the filter calc that means that we can impute *any* value for the nulls (that represent the other data set), and in that case why not use one of the existing values *instead* of the ZZZZ? So what the new Merged calc does now is use a FIXED Level of Detail expressions to impute the first (alphanumeric) non-Null value of the particular attribute instead of the 'ZZZZ'.

     

    I've attached the new version of the workbook.

     

    Jonathan

0/9000