Troubleshooting
Problem
I want a command that will look at the value of an SPSS date variable and count the number of calendar weeks, or parts thereof, from the beginning of the same year. This is like the xdate.week function, but that function always treats the start of the week as the day on which Jan. 1 fell in that year. So the XDATE.WEEK result for Jan 4. would always be 1. If Jan. 4 fell on a Sunday, then I want my command to set the week number for Jan. 4 to 2, showing that it is the second calendar week in that year. In other words, the Sunday on or just before Jan. 1 is the starting point for counting weeks. Suppose that I wanted to treat Monday, rather than Sunday, as the beginning of the calendar week. Would the adjustments described above be possible in that scenario?
Log InLog in to view more of this document
Historical Number
15395
Was this topic helpful?
Document Information
Modified date:
16 April 2020
UID
swg21476103