WestCoastProjects
WestCoastProjects

Reputation: 63201

Adding a Calculated Field as a Line Chart to an existing Tableau Chart

As shown in the screenshot there is a calculated field TrendLine that "wants" to be a straight line living in the same chart as the main/upper scatterplot. So two sub-questions here:

Upvotes: 1

Views: 1086

Answers (2)

Alex Blakemore
Alex Blakemore

Reputation: 11921

You don't have to have the same mark type (chart type) to use a dual axis. One of the main reasons to create a dual axis chart is to combine two different mark types. The main requirement is that the fields on the axis in question have the same data type. You usually want to also synchronize the axes, say by right clicking on the right most pill

If you have multiple measures on the row or column shelves, you will usually get a stack of mark cards on the left margin, with the All marks card at the top. Choose the mark card for your measure of interest and change the mark type from automatic to whatever you wish. Or change the All marks card to affect all of them.

The one exception is when you have exactly one measure on rows and one measure on columns. Then you only get a single marks card.

Upvotes: 0

Juanma
Juanma

Reputation: 195

I'm sending my answers to your two questions. Hope you find it useful.

  1. In order to have the option "Line Chart" enabled you should have 1 "date" field.

I find the "show me" option quite useful in order to know what I need to have for each specific graph.

When you hover over each graph type, you will see the necessary fields/dimensions/measures. As shown in the below screenshot, for lines, you need "date", 0/more dimensions and 1/more measures.

enter image description here

  1. if your objective is to have both graphs together, just right-click on the y axis of your second graph and click on "dual axis". This will let you populate both graphs together.

enter image description here

Based on your comment, we can create a diagonal reference line for your second graph when not having date field.

Steps:

1- Click on AVG(TrendLine) in the rows tab (at the top).

2- To the left of your graph, marks, you will have the line option there.

enter image description here

Please feel free to send a sample workbook if it's possible.

Thanks

Upvotes: 1

Related Questions