I was new in Tableau and I was stuck while applying filters on date. I have a data set that has a field called "Start Date" and a field called "End Date".
What I want?
Create a filter with the following options:
- Records that have a "Start Date" prior to the current date, called "Pending Records"
- Records that have an "End Data" after the current date, called "Expired Records"
- Records that have a "Start Date" equal to or greater than the current date and have an "End Date" less than the current date, called "Active Records"
I want all of these to come under one single filter with all the three choices. Is it possible?
For adding a status for "Records with an end date within 6 months" I used this code:
IF
(
[Start Date] > TODAY()
) then "PendingRecord"
elseif (
[End Date] < TODAY()
) then "ExpiredRecord"
elseif (
[Start Date] <= TODAY() AND
([End Date] > TODAY() AND
[End Date] > DATEADD("month",6, TODAY()))
) then "ActiveRecord"
elseif (
[Start Date] <= TODAY() AND
([End Date] > TODAY() AND
[End Date] <= DATEADD("month",6, TODAY()))
) then "EndingIn6Months"
END
Now this piece of calculated field created a filter with 4 options. But, "EndingIn6Moths" is really a subset of ActiveRecord. So, when a user selects ActiveRecords, it should also include EndingIn6Months. Is this possible? and even is it possible to auto check a filter (EndingIn6Months) when the user checks ActiveREcords option?