If you are running a tracking study you may want to have tables which focus on results only from the latest month or quarter.
This article describes how to use Displayr's built-in filter functionality to automatically work out which people are in the latest period. This method also allows for updating of data without the need to re-make the variable.
In this example, we will create a variable set that includes a variable for the last 4 weeks and one for the previous 4 weeks.
Requirements
- A Date/Time variable in your data set OR...
- A text variable of a date in one of the standard formats, e.g. such as month/day/year or day/month/year, which can be converted to a Date/Time variable by selecting it in the Data Sources tree and changing General > Structure to Date/Time.
Please note these steps require a Displayr license.
Method
Last 4 weeks filter
1. In the toolbar go to the Anything icon > Filter > New.
2. Select your date variable. In this example, we will use a date variable called Interview Date.
3. Set the condition to is within last period, the value to 1 and then in the drop-down select Four Week.
4. Update Specify conditions to generate a default name... at the very top to Last 4 Weeks.
5. Press Create filter.
Previous 4 weeks filter
1. In the toolbar go to the Anything icon > Filter > New.
2. Select your date variable.
3. Set the condition to is within last period, the value to 2 and then in the drop-down select Four Week.
4. Press Add Condition.
5. Select your date variable.
6. Change the condition to 1 Four Week.
7. Now change the condition to is before last period.
8. Update Specify conditions to generate a default name... at the very top to Previous 4 Weeks.
9. Press Create filter.
Combine filters
1. Select both variables in the Data Sources tree.
2. Right-click > Combine.
3. In the object inspector, update the Label field.
4. If there is a warning in orange, click Fix > OK.
See Also
How to Dynamically Filter Data to the Latest Waves
How to Create a Complicated Filter
How to Calculate the Difference Between Two Dates