The easiest approach to explain is to create a parameter that allows the user to select exactly one value from a prescribed list of strings, such as "7 days", "14 days"... etc. You may also want a few other choices like "Start of Time", or "All users". Whatever options you like.
Then create a (boolean) calculated field that denotes whether the current data record should be included based on the current parameter value. Something like
if [My Filter Param] = "7 Days" then
[7 Days] = 1
elseif [My Filter Param] = "14 Days" then
[14 Days] = 1
...
else
[My Filter Param] = "Start of Time"
end
Then put your calculated field on the filter shelf, choose True as the filter value, apply to whatever worksheets or data sources matter, and of course display your parameter control.
This is a pretty general technique, combine a parameter (for asking the user to make a choice) with a boolean calculated field (to apply the users choice) and the filter or other shelf for applying that calculation to a visualization. Works for all kinds of problems.
If your data sets are large or slow, you can optimize performance in a few ways. Say by using boolean fields in your data instead of integers, and by using integer valued parameters instead of strings so you can use a fast case statement to replace all the string comparisons (although Tableau can optimize some of those comparisons away) If you do use an integer parameter, you can still define the choices to display meaningful strings in the parameter control. See the edit parameter dialog.
Finally, you could consider making your analysis and viz a little more flexible by adjusting your pre-processing to produce data with just two columns -- User and Date_of_Last_Key_Action . Then your users could just use the built-in date filter controls in Tableau to view based on any time range, .e.g, the last 13.5 days if they wanted. You wouldn't need a parameter or calculated field in that case.
pivot
ing a table – shripal mehta