Hi,
I'm new to tableau and trying to solve one problem.
In the attached workbook, I want to show top 20 companies by "Estimated Revenue" and top 20 companies by "Total employees". I want show them in one viz and when user select By Revenue top 20 companies should appear based on "Estimated Revenue" field and same with the employees, when user select By Empoyee top 20 companies should appear based on Total employees field. I think we can use parameter functionality in this case but not sure how to create it.
I addition, I want to to sort them in descending order. I did it but when I change the Hub filter the sort functionality does not work.
Please see attachement.
Thanks in advance.
Hi @Atul B ,
This is absolutely possible and you're on the right track. To do this, you'll want a parameter that creates a dynamic measure that you place in the Top N filter and the field you filter on for the sort. I've set this up in the workbook attached under the Top 20 by Revenue sheet.
Primary Areas Affected:
- We created a list-formatted parameter and showed the control
- We created a calculated field called PARAM//Top N Switch that we placed in the table in lieu of your previous measure
- This activates the toggle functionality
- We then edited your Top N filter to refer to PARAM//Top N Switch, as that serves as a placeholder for our measures of interest. That creates your dynamic Top N.
- We modify the sort on Account Name to refer to a field and sort Descending by PARAM//Top N Switch.
- I also inserted the parameter into the title so that the end user gets a large visual cue that the viz is changing.
- To do this, we edit the title and use the Insert button to add in the parameter.
Resources:
- Dynamic measure: https://help.tableau.com/current/pro/desktop/en-us/parameters_swap.htm
- Info on CASE statements: https://help.tableau.com/current/pro/desktop/en-us/functions_functions_logical.htm
- Sorting on fields/nested: https://help.tableau.com/current/pro/desktop/en-us/sortgroup_sorting_computed_howto.htm#sort-specific-fields-in-the-viz