1
votes

I am trying to put a filter in Tableau which automatically shows data for last two days. I tried using Dense rank (which works in SQL) but in Tableau I can't figure out which aggregator function to use with it.

How can I put a filter to show latest two dates in Tableau?

1

1 Answers

6
votes

Filtering based upon the most recent dates is generally easily done by:

  1. Right click and dragging the date field to the filter shelf
  2. Select "Individual Dates"
  3. From the filter dialog, choose "Top" and "By field"
  4. Select "Top", 2 (for the most recent two dates)
  5. Select the date field and choose Maximum for aggregation.

This Tableau KB article also has a good write up of the technique: http://kb.tableau.com/articles/howto/filter-on-last-date-in-the-data-source