Rhonda
Rhonda

Reputation: 1721

Tableau to create single chart from multiple parameters

I have tableau workbook online

Before, I had filter for single Principal, and applied to all CUSIPs, and I was able to plot all the inflation-adjusted principals based on Index ratios for a particular date, (refer tab Inflation-Adjusted Trend) i.e.

enter image description here

Now, I have multiple filters based on multiple Principals, i.e. buy one CUSIP for $1500, buy another for $900, etc (refer tab Infl-Adjusted Trend 2)

enter image description here

These were the columns and rows

enter image description here

But I do not like the format of this graph.

I wish to have all the lines together in one graph, just like the single-principal tab below ..... how to fix this? How to bring all the values into one chart?

enter image description here

Upvotes: 0

Views: 517

Answers (1)

Andrew LaPrise
Andrew LaPrise

Reputation: 3413

You currently have six calculated fields calculating your inflation-adjusted principals, one for each CUSIP. Here's what that table might end up looking like:

+-----------+-------------+-------------+-------------+-------------+-----+
| CUSIP     | 912828H45 P | 912828NM8 P | 912828PP9 P | 912828QV5 P | ... |
+-----------+-------------+-------------+-------------+-------------+-----+
| 912828H45 | $100        | NULL        | NULL        | NULL        | ... |
| 912828NM8 | NULL        | $455        | NULL        | NULL        | ... |
| 912828PP9 | NULL        | NULL        | $132        | NULL        | ... |
| 912828QV5 | NULL        | NULL        | NULL        | $553        | ... |
| ...       | ...         | ...         | ...         | ...         | ... |
+-----------+-------------+-------------+-------------+-------------+-----|

There's definitely a better way. Your fields are set up like this:

IF [Cusip] = "912828H45"
THEN
[912828H45 Principal] * [Index Ratio] 
END

Instead of setting up one field per CUSIP, make a single field that calculates that value for each CUSIP.

IF [Cusip] = "912828H45"
THEN
[912828H45 Principal] * [Index Ratio] 
ELSEIF [Cusip] = "912828NM8"
THEN
[912828NM8 Principal] * [Index Ratio]
...
END

Now your table looks like this.

+-----------+------------------------------+-----+
| CUSIP     | Inflation-Adjusted Principal | ... |
+-----------+------------------------------+-----+
| 912828H45 | $100                         | ... |
| 912828NM8 | $455                         | ... |
| 912828PP9 | $132                         | ... |
| 912828QV5 | $553                         | ... |
| ...       | ...                          | ... |
+-----------+------------------------------+-----+

That's a LOT easier to work with. Drag that single field into Rows and color by [Cusip].

Upvotes: 2

Related Questions