How To Filter Last 7 Days in Tableau

preview_player
Показать описание

Foreign I have a new sheet open let's start by building our line chart with date I'm going to right click date drop it on columns I'm going to choose day of date. I'm gonna grab sales put it on rows to end with a line chart. Let's add a new calculation to test if the date is within the last seven days I create a calculated field I'm going to call this last seven days filter. The calculation is going to be referencing if a function called today.

Generates uh today's date you can use it in a calculation so let's first test if date is less than today it's going to be a true or false yes or no so if I wanted to be the last seven days I needed to be date is actually less than or equal to today and I I test if date is greater than or equal to last seven days ago so I'm going to type and date is greater than or equal to date add I'm going to add days

I'm going to subtract seven there is no date subtract so I do state add angle type minus seven and I'm going to reference date I'm sorry reference today. So is date greater than date add minus seven days from today let's click apply okay I'm gonna grab my filter put it on the filter Shelf and keep only True Values now I have only the last seven days hope that helps
Рекомендации по теме
Комментарии
Автор

its showing me only the false option I don't see true after I drag it in the filter

somtianya