You can do it with the following
if index() < 5 then attr([State]) else "Other" end
The only downside is that you need to have State in your view. So for example if you make a bar graph it would not be much of a problem, but your "other" bar may have sections.
It would probably help if you have a dummy dataset to play with.
Using attr([String) does allow me to use the string in the aggragate evaluation and I appreciate the information, however it does not solve tye core issue as my Index() function needs the [State] in view to work. So I can't delete the [State] from the view and use the above formula instead - to hide the "Other" states.
In the meantime I am just using the Top N [States] and filtering the rest. Let me know if you have any other ideas for handling my scenario. Here is a screen shot of the graph. Thanks.
Column one is the index, two is the result of the above formula, three is the dimenions grouping to establish the index.
Uploading a workbook with dummy data would be greatly helpful.
Create set with top n by sales wit parameter.
Create calc as
if [Set] then [State] else "Others" end
Drag this into view and get members as states and others group.
Thank you for responding.
Initially I used the [Set] in a formula, but the set only shows the Top N for the entire data set. In view, I typically have a higher level region filter. How do I get the set to include the Top N for the selected region. Here is an example.
Top N using set of [Country] - with [Region] dimension as a reference
1. China (Asia)
2. Japan (Asia)
3. Russia (Russia Caspian)
4. Canada (North America)
5. South Korea (Asia)
In view, I am filtering on the Asia region and want the Top N (3) in that region. The results I would like to see:
3. South Korea
As opposed to current results I am seeing now. [Set] of [Country] and formula to group based on Top N (3).
1 of 1 people found this helpful
Please "add to context" in region filter and get correct values.
Fixed level of detail expressions solved my issue. If you need practice working with fixed level of detail expressions, I recommend the on demand content from the 2015 Tableau conference.
i have come across the same issue where i want to show the Top 10 country and the rest as others.
however when ever i use other filters on the dashboard to and expect the top countries to change according to filter selections..it shows the top countries only from the already top 10 countries and not at the specific filter that has been selected.
So this is caused by the Order of Filtering Operations within Tableau. Top N, Sets and FIXED LoDs are all calculated before any "regular" dimension filters are applied (so the Top N is calculated before your filters). You can, however, bump a filter up the pipeline by making it "in context"...this means that it gets applied before any Sets, Top N, or FIXED LoDs are calculated.
Hope that helps