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

心不动则不痛 提交于 2019-12-08 06:40:15

问题


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:


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



来源:https://stackoverflow.com/questions/30880457/how-to-put-a-filter-to-show-latest-two-dates-in-tableau

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!