How to merge two data sets in Tableau via relationship

0 votes

I'd want to integrate two data sets and generate a combined bar/line chart. The columns should be months, and the rows should represent the total values for that months. However, one of the data sets should be displayed as a bar chart, while the other should be displayed as a line chart. This is how it should look:

dataset 1 would be the bars and dataset 2 would be the lines

I have the following data sets:

data_set1 = [{'value':10,'date':2020-01-01},{'value':15,'date':2020-01-02},{'value':5,'date':2020-01-03},{'value':10,'date':2020-01-04},{'value':120,'date':2020-02-01}]

data_set2 = [{'value':100,'date':2020-01-01},{'value':200,'date':2020-02-01}]

I've been able to create the bar chart (see below): This chart shows dataset 1 by month

However when I try to add the values from the second data set by also adding it to the columns section, I get the following error:

"In order to use fields from dataset 2, a relationship needs to be created with dataset 1. Select Data > Edit Relationships to open the Relationships dialog box."

I tried to create a relationship between these two data sets by the following process:

  1. Set the Primary Data Source as data_set2, since that is the smaller dataset.
  2. Selected Custom to create a custom relationship
  3. Selected Add and set both the 'Primary Data Source Field' and the 'Secondary Data Source Field' as Date
Apr 14 in Tableau by Neha
• 6,260 points
19 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Tableau

0 votes
1 answer

How to plot two sets of points on one scatter plot in Tableau

If you want one mark for each ...READ MORE

answered Apr 5 in Tableau by Neha
• 6,260 points
25 views
0 votes
1 answer

How to add filter to show latest two dates in tableau?

Steps for filtering based on the most ...READ MORE

answered Jun 21, 2018 in Tableau by Atul
• 10,230 points
547 views
0 votes
1 answer

How to refresh the extracted data source automatically in Tableau Desktop?

Hi AwesomeSauce, This comes up every so often!  Tableau ...READ MORE

answered Aug 14, 2018 in Tableau by Naruto
• 710 points
3,604 views
0 votes
1 answer

How to get multiple Sets of Measure Names with different Filters on a single sheet in Tableau?

The easiest solution to your query is: 1) ...READ MORE

answered Aug 23, 2018 in Tableau by Naruto
• 710 points
10,913 views
0 votes
1 answer

How to merge Year ,Month and date in Order Date in Tableau?

Hi, you can simply drag the Order ...READ MORE

answered Aug 24, 2018 in Tableau by AwesomeSauce
• 860 points
1,282 views
0 votes
1 answer

How to make two parameters dependent in tableau?

Hi, 2 parameters are dependent when one ...READ MORE

answered Mar 12, 2019 in Tableau by Cherukuri
• 33,010 points
7,046 views
0 votes
1 answer

Plotting multiple lines in Tableau

First, drag & drop measure values & ...READ MORE

answered Mar 14 in Tableau by Vaani
• 5,040 points
27 views
0 votes
1 answer

Creating a stacked waterfall chart in tableau

You can try this as a solution: 1.) ...READ MORE

answered Apr 5 in Tableau by Vaani
• 5,040 points
66 views
0 votes
1 answer

How do I create a bubble chart that is aligned in Tableau?

Put your dimension in the column shelf Put ...READ MORE

answered Apr 18 in Tableau by Neha
• 6,260 points
28 views
0 votes
1 answer

Alternative to Tableau Public

Tableau Desktop offers a 14-day trial period ...READ MORE

answered Apr 12 in Tableau by Neha
• 6,260 points
28 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP