0
votes

I used an Apriori algorithm to view the frequent relationships in the dataset and I want to do a dashboard to better visualize this data but I don't know how to do this filter.

This is the bar chart that I created to show the support (amount of times something happend) and the confidence (probability of B happening given A) of these associations: Apriori Chart

Next to it on the dashboard, I'll have a table with the full dataset used in this Apriori analysis where I have more information such as ID, Income, Hours Worked, etc: Table from different data source

How can I create this relationship? The two data sources don't have a column in common that I can use for that.

I would need some way to:

Split the values in the antecedents columns by comma and filter only those columns with value equal to 1 in the other dataset


**Dataset A**

'Age Range <=30, Joblevel 1, Maritalstatus Single'

->

'Age Range <=30'

'Joblevel 1'

'Maritalstatus Single'





**Dataset B**

'Age Range <=30' == 1

'Joblevel 1' == 1

'Maritalstatus Single' == 1

Clicking this would filter the table next to it

Is there any way I can do this in Tableau?

You can download the tbwx i used in this example here https://community.tableau.com/servlet/JiveServlet/download/1083124-384949/Apriori.twbx

Thanks in advance for the help!

1

1 Answers

0
votes

I am not able to check your twbx on the machine I'm using but I think you should be able to do this. The fields in the 2 data sources need to match so manipulate the data sources the make this happen.

For data source 1 there's a function SPLIT which will mean you are able to split the comma separated string to 3 fields.

Putting those 3 fields to the Detail shelf of your bar chart (or even Rows and hiding the header) will mean you can use them in an action filter.

Your second data source is a cross tab - post pivot. You should be able to pivot this data source. Highlight the measures and pivot them. This will give you the field Pivot Field Names and Pivot Field Values.

You only want to keep those with a value of 1 so create a calculated field

[Lookup1]: IF [Pivot Field Values] = 1 THEN [Pivot Field Names] END

Duplicate this field twice so you have Lookup1, Lookup2 and Lookup 3.

Then you should be able to action filter the table.

In the action filter set it up so SplitField1 = Lookup1, SplitField2 = Lookup2, etc.

Fingers crossed this works, I haven't been able to test so I am pulling it out of my head.