Introduction
This article describes how to set time periods for date questions. When preparing a table or chart of a Date Question Q automatically examines the data to make its best guess as to the appropriate time unit of analysis (e.g., weeks, months, quarters).
Where to set time periods
The time periods are a Value Attribute of a Date Question and can be accessed in the same way as other value attributes (e.g., by right-clicking on one of the date categories on a table and selecting Values). Additionally, they can be accessed in the following ways on plots:y
- Time Series Plot Right-click on the date axis and select Format Axis
- Trend plot Right-click on the date axis and select Format Axis and select the Date Question
- Column Plot with Trend Right-click on the trend lines and select Format/Configure Trends and select the Date Question tab.
Buttons, options and fields
Aggregation The level of aggregation of the data. For example, if Week is selected, the data is shown as weekly data.
Period type The range of dates to be displayed.
- All Data All the dates in the data file. Natural periods will be used. For example, if Aggregation is 1 Month then whole calendar months will be used, even if the data does not end exactly on the end of the month.
- Date Range Limit the variable to dates between the specified Minimum and Maximum. The last period will end on your maximum date, and periods will be calculated back from then. For example, if you provide a date range from 2 Mar 2017 to 27 May 2017 then the periods will be 28Feb..27Mar, 28Mar..27Apr and 28Apr..27May. If you want round months then choose Maximum at the end of the period (e.g. the end of the month).
- Duration The number of time periods to be displayed. Natural periods will be used. For example, if Aggregation is 1 Month then whole calendar months will be used, even if the data does not end exactly on the end of the month.
Note, when you apply a filter that removes a range of dates from this variable, then the dates shown in your table will change accordingly. For example, if your date question contains dates from January to December, and you configure it to show the last 6 months, then you will see July, August, September, October, November and December. If you filter that table to dates before 1 October then you will see April, May, June, July, August and September.
Next
How to Calculate the Difference Between Time Stamps