please see the attached
create a parameter for the user input
create a statement
then create the viz
If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution. Thank you.
plot by metric.twbx 2.4 MB
***Edited to attach workbook***
Hi Albert, sure, set up a parameter having the descriptions of your measures. Here I'll use some measures from SuperStore.
Then create a calculated field which will show the measure selected by the Parameter.
Build your view, and Show your Parameter control:
Workbook is attached.
Thank's a lot, this really helps.
What I want to do next is to setup a different center point for each one of these. So in your example,profit would have a center point of 0.2, sales would have a center point of $500 etc.
Currently the center point is set as the halfway point between the min and the max, but I want to be able to manually set it for each metric that you have placed in the "heat map by"
Is this possible to do?
Hmm, I have often wished I could put a calculation in the color range beginning, end, and center points, but I haven't figured out how to do it.
In this case, if you only have three measures, I guess I would create three map worksheets - one for each measure. We'd put all three sheets in a container on a dashboard, and use the parameter to show the map selected and hide the two that are not selected.
So, set up a Sales map, and set the center point however. Notice here I have mapped SUM(Sales), not the parameter-driven calculated metric. Duplicate this as two more sheets and set up Profit and Profit Ratio.
Now we'll create a filter for each measure's sheet to make it show if its parameter value is selected, or be blank if not. We do this by setting TRUE or FALSE. When this filter evaluates to FALSE the entire sheet will go blank (except the Title). So we'll put the following filter on the Sales Sheet. You can see that Profit Ratio is chosen in the parameter selector on the right, and the sheet is blank.
Duplicate this calculated filter twice - one for Profit and one for Profit Ratio, and put the filters on the corresponding Profit and Profit Ratio worksheets.
In a new dashboard, drag a floating vertical container onto the screen. Drag your three maps into the vertical container.
For the blank sheets - Profit and Profit Ratio - the Title of the worksheets is showing. So go into each of the three sheets and hide all the Titles. Just right-click and choose Hide Title.
Let's create a Title Sheet. Open a new sheet, click into the Title and insert the Parameter value. No need to have any fields in this view at all. I usually set the Marks card to Polygon, and then format the worksheet so it doesn't show any lines.
Now back on the dashboard, drag the Title sheet into the very top of the Vertical container holding your maps:
And now we are left with the problem of the legends of the blank sheets remaining on the page. I think this can be handled with some elaborate showing and hiding of sheets floating on top of them, but I'd have to work through it to figure it out. In the meantime, maybe someone else knows a more automatic or streamlined approach .
Hope this helps,
1 of 1 people found this helpful
Ok, I just spent way too much time figuring out how to dynamically show and hide the legends , but I'll probably want to use it some day.
I won't show all the steps - not sure you needed this and it may be more involved than its worth, but the general idea is that I put the three legends in a floating horizontal container:
Then I put another floating horizontal container on top of it which has three sections (one for each legend) which will show white or transparent based on the parameter selected. So none of the legends actually disappear, but the two not selected get covered with white:
Workbook is attached.
Thanks a lot for posting this! Was wondering if you could save in a prior version of tableau. I have 10.5.1 and it won't let me open your workbook.
Thanks again for all the help,