There seem quite a few other posts regarding how to get top N and bottom N. It is a recurring topic. Here is an example:

How to create Top 5 and Bottom 5 values with respect to a Measure in Bar graph in same worksheet

Just figured out a simple way of dealing with this class of questions.

Top 5 and Bottom 5

For top 5 and bottom 5, this line of code as filter will suffice: (Use Rank() if you wish)

Rank_Unique(Sum([Sales]))<=5 or Rank_Unique(-Sum([Sales])<=5 or

Rank_Unique(Sum([Sales]))<=5 or Rank_Unique(Sum([Sales],'asc')<=5 We are using both descending and ascending sorts. That's it. (The first formula may not work in some Tableau desktop versions. Rank_Unique(-Sum(sales)) may not be accepted).

Sort the result to make it look better. But sorting may not be a requirement.
4

Very often people need to get the measure value on the max(Date), or the min(Date), or next to max(Date), or a date relative to the min/max date etc. (Date can be in Year, Quarter, Month, Week, Day or even second.) It is often a struggle to pick out that date and its associated measure value.

The first thing that may come to our mind is to write a good conditional like

Date=Max(Date) ? Or use Window_Max(Max(Date))? Then datediff()?

I don't know how those will work.

Two articles have been selected as Best of the Tableau Web March 2015 :

Grouping Lower % Bars in Bar Chart

Nested Sorting and Top N per Category via Rank_Unique

Excited about the selection.
1

There are two aggregates in the title. One is for creating bins. The other is for calculating distribution over bins of aggregate functions like sum, average, count etc. In case of count distribution, it is also known as histogram.

In Tableau, there is a menu function for creating bins for any numerical dimension or measure. The bins becomes a new dimension and is mostly useful for creating histogram and the like distributions. Each bin thus created is of equal size.
3
Blog Archive
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.