SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
Expand all | Collapse all

How to convert date to quarter and then split files on quarters

  • 1.  How to convert date to quarter and then split files on quarters

    Posted Thu May 27, 2021 03:24 PM

    I have a dataset with dates in it and I want to split the file on quarters. I can convert the variabele to quarters with years with "FORMATS variable (QYR)." but when I split on this variable it still remembers the underlying dates.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: How to convert date to quarter and then split files on quarters

    Posted Thu May 27, 2021 03:45 PM

    FORMATS just affects how a date is displayed. It doesn't change the underlying values. You can extract the quarter for a date like this.

    compute qtr = xdate.quarter(yourdatevariable).






    #SPSSStatistics
    #Support
    #SupportMigration