1
votes

I have a data set that includes employee name (rows) and # of calls in 2016, 2016 revenue, # of calls in 2017, and 2017 revenue for each employee. Is there a way to plot (employee's 2016 calls, employee's 2016 revenue) AND (employee's 2017 calls, employee's 2017 revenue) on one scatter plot in Tableau?

I've tried to plot 2016 calls and 2017 calls (columns) on a dual axis and 2016 revenue and 2017 revenue (rows) on a dual axis, but it ends up plotting all possible (X,Y) combinations, when there should only be two points per employee (2016 data and 2017 data).

Alternatively, is there a way to plot a line through each of the 2016 points if I've calculated the slopes of the lines I want to use?

1

1 Answers

1
votes

If you want one mark for each combination of employee and year, the simplest solution is to shape your data source to have one data row for each combination of employee and year.

So revise your data source to have the following columns:

  • Employee
  • Year
  • Calls
  • Revenue

Then try Employee on Detail, Year on color (as a dimension), SUM(Calls) on Columns and Sum(Revenue) on Rows

If you don't want to reshape you data as a preprocessing step, you can accomplish the same goal in the Data Source editing panel by UNIONing the original source with itself, add a Year field based on the Table Name field and creating calculated fields to have versions of Calls and Revenue that include the values only for that one year.