Thank you for sharing a workbook with sample data. Knowing a bit about the data source involved here would help a bunch in determining options. I would create a view by modifying the data source. In the attached workbook, I have copied the data source and removed all fields except Date,Facility, the Category and the Category Type (5 or 5a). I then pivoted the data so that we create a single Category Type field. This eliminates the need to utilize Measure Names/Values which is causing the problems encountered and we can instead directly address the Categories.
Once the data is pivoted, we can create a three new calculations:
Den - If [Category]="D" or [Category]="E" then 1 else 0 END
Num - If [Category]="E" then 1 else 0 END
and PCT - sum([Num])/sum([Den])
and with these fields we can create the same two views originally in the attached workbook. The advantages is that we can create a Action Filter from the crosstab view to the line chart based on selecting a Category Type (5a or 5) and have the associated line chart appear. We can also set the filter to exclude all values when nothing is selected, in which case the line chart will disappear.
The attached workbook is in ver 9.3 of Tableau. The solution depends on the data source being one that can be pivoted though so start there and determine if this is possible.
Book1_pv.twbx 61.3 KB
Dan -- I created two sheets: One that displays Pct5, and one that displays Pct5a. Then I did sheet swapping based on the value of the parameter.
Is this what you are looking for?
Actually, if the difference between the two sheets is just a matter of measure values, you could create a calc that says:
if [parameter]="this" then [this-measure] elseif
[parameter]="that" then [that-measure] end
And then just display the new calc. (Or multiple calcs if there are multiple things to display based on the value of the param. And you would only need one sheet, and not need swapping.
But if you also have to change the display by DIMENSION as well, (such as 5Category vs 5aCategory) then you'd probably be better off with separate sheets.
So the Dashboard2 in the attached is swapping the sheets in a container in the lower half based on the selection chosen in the parameter.
If this is what you are aiming for, we can discuss how to do that.
Book1 a.twbx 35.6 KB
Just a point of protocol. When you attach a sample workbook, it helps to specify the version of the workbook. I had to try 3 versions before I found the one you created this in. As you see in Patrick's reply, he just upgraded your workbook to 9.3 and then did his work. If you don't have 9.3, you won't be able to see what he did.
Stating the version up front saves a lot of trouble.