user5017527
user5017527

Reputation: 21

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

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?

Upvotes: 1

Views: 7633

Answers (1)

David F. Severski
David F. Severski

Reputation: 493

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

Upvotes: 6

Related Questions