Creating a base date for analysis in tableau

50 Views Asked by At

I have a problem where i want to set a base date to a date time variable in the database. I would then use the base date for my aggregations. And the days subsequent to this base date would be categorised as Day1, Day2 and so on.enter image description here

So for example, if I want to see cohorts of orders created by the base date - I would want the calculated after this date. I don't want to do this using a date filter.

Image below:

1

There are 1 best solutions below

2
On BEST ANSWER

It seems like you could use the DATE function to convert your field, like this:

DATE([Acquisition Date])

If you don't already have the year value stored, but have a method in mind to add it, you could use MONTH([Acquisition Date]) to obtain the month and date and DAY([Acquisition Date]) to obtain the date. You could then use MAKEDATE function to build the date or MAKEDATETIME function to build the datetime value.

Once it's stored as a date value, you could use DATEADD to add and subtract days to it as needed.

There are multiple formulas available for converting Tableau dates, described here: https://help.tableau.com/current/pro/desktop/en-us/functions_functions_date.htm

Is this what you're looking for?