Tableau - Adding Dates

To return a future or past date in Tableau use DATEADD


                    DATEADD(date_part, interval, start_date)
                     

The date_part can be:

  • day
  • week
  • month
  • quarter
  • year

Example

Add 1 month to 2017-09-01


                    DATEADD('month', 1, #2017-09-01#)
                     

Find the date 7 days ago


                    DATEADD('day', -7, TODAY())
                     

Some tips:

  • Change data type to date
  • Change data type to discrete

These calculations come in handy when you need to look at project deadlines, forecasts or look back at advertising spend from 7 days ago to calculate ROI.





Services
  • SEO
  • Online Advertising
  • Online Ordering For Restaurants
  • Data Analytics

  • External Resources 4 Developers
  • CSS Tricks
  • MDN

  • Dash-Intel.com is a Power BI and Tableau resource site around data visualizations and building business dashboards.

    Data Analytics consultants in Edmonton, Alberta specializing in Tableau and marketing analytics

    Copyright 2020 Dash-Intel.com Terms / All rights reserved.