1 of 1 people found this helpful
It looks like the field the two data sets share in common is the Date field. If you need to keep the data sources separate, you could use the Data Source tab at the bottom to create a join based on this field. This is how I set up and walked through it:
- Created excel spreadsheet with two tabs, one for marketing spend and one for campaign data. Matched the formatting to the .png files you showed.
- Opened Tableau and connected to the Excel file. Brought Campaign Data out to the "Drag sheets here" area to check formatting. Noticed the table has date in columns rather than rows, so I selected those columns, right clicked and chose Pivot. Renamed the new column Date.
- Brought Marketing Spend out to the right of Campaign Data, and chose Date in the dropdown menu under "Data Source" and Date1 under "Marketing Spend". Now our spreadsheets are joined!
- I named the column with Lead, SAL, and SQL "Leads" for lack of a better term
- Moving over to Sheet 1, I brought Date1 onto the Rows shelf, and Leads onto the Columns Shelf
- I dragged Marketing Spend onto the Text button, followed by Pivot Field Values onto the Text button. This visually gave me what my calculation would look like.
- I clicked Analysis -> Create Calculated Field, and wrote a calculation that I named Cost Per Lead. The calculation looked like this: SUM( [Marketing Spend] ) / SUM( [Pivot Field Values] )
- I dragged this new measure onto the Text button, which displays the Cost Per Lead right where I want to see it - directly underneath the Lead counts.
This solution could vary depending on your exact data, but I'll attach a couple images so that you can see how it came together. I hope that helps!
Thank you so much for the very detailed response. I'm going to try it out this afternoon/tomorrow and will let you know if I have any questions! Really appreciate it.