3 Replies Latest reply on Jan 8, 2019 8:56 AM by Jonathan Drummey

# Multiple Levels of Aggregation in X-axis

Hi all,

I'm facing a problem regarding multiple levels of aggregation in Tableau.

Here is how my data source look like First I created a lineplot aggregated by Share Price and colored by percent as follows, the measure value is portfolio intrinsic value. Then second worksheet is a scatterplot aggregated by GS price and also colored by percent, the measure value is output portfolio intrinsic value. Then, my question is, how could I plot the two charts in the same graph? The final output should be the first worksheet including the three points where share price  250.

Since the two plots are aggregated by different levels and with different measurements, not sure how to plot them in the same graph.

Basically the idea is that the first worksheet is a whole range of share price and the corresponding portfolio price, the second one is a input share price from the parameter and shows the relevant position in the first worksheet.

Thanks for any advice and help!

• ###### 1. Re: Multiple Levels of Aggregation in X-axis

Hello Jingshu,

Would you have a small packaged workbook to share with the community - Packaged workbooks and flows: when, why, how

In general, I think the solution here is to utilize Level of Detail calculations - Overview: Level of Detail Expressions - Tableau

Best of luck

Patrick

1 of 1 people found this helpful
• ###### 2. Re: Multiple Levels of Aggregation in X-axis

This can be done as a dual axis chart, but it would be best if you could share the sample data source that you are showing above and possibly your twbx file.

• ###### 3. Re: Multiple Levels of Aggregation in X-axis

Since you want to use Share Price as a dimension and GS price as a dimension first thing I'd look at would be to pivot (aka unpivot/transpose) those two columns. This is because of a basic guideline in Tableau - if we want to use a field as a dimension then it should be generating rows, and in this case we want to use two dimensions as if they are one dimension.

Then you'd have a new pivot field values column with all the values of price and a pivot field names column for Share Price or GS Price. The value could be on Columns and then you'd use a dual axis for the two measures on Rows. Depending on how your data is set up there might need to be a little extra work with filters or calculations to ensure that the measures on Rows aren't duplicated.

(FYI a couple of years ago Tableau announced that they were working on layering in visualizations so we wouldn't have to do the pivot or other data prep for situations like this, we haven't gotten there yet.)

Jonathan