I'm sure there is a more elegant and complete solution, but here's a simple one to get you started.
- I created a Parameter called "order date parameter", which we have to cast as string since you want users to type in a value. Using Dates here only gives your users a static list of dates to select from, no option to type in.
- We then need to tell Tableau that the string is actually a date, so I created the calculated field "Parameter Date" and cast it as a Date.
- Then I created another calc to simply substract 5 from my new Date field. Tableau is smart enough to know I mean 5 days since I am subtracting it from a date field. You could actually just subtract that number in the calculated field built in step 2 instead of creating another calc altogether.
Hope that helps!
ParameterDate.twbx 1.1 MB
Thanks for the detailed explanation Lindy. But subtracting the 5 days on the step3 you mentioned above will remove the calendar days and not the business days. For example, if I use the formula "Input date - 7" the calculated field will consider Saturday & Sunday in the calculation of 7 days. I don't want weekends(saturday & sunday) to be part of the calculation. Could you please help with the implementation.