Without changing the format of your date string, I can think of two options:
First, assuming your data is regular (meaning there are no gaps in the date column), you can simply import your data with a hard-coded frequency and start date - this will force the destination workfile to use your frequency and as long as the first data row matches the first hard-coded start date, the data should line up appropriately, like this:
Code: Select all
import c:\files\q_year.csv @freq Q 1948Q4
This is the simplest option.
If your date values are not regular or you'd rather not specify a hard-coded start date, you can do the following instead:
First, import everything into a new undated workfile first (and make sure to read in your date column as an alpha series):
Code: Select all
import c:\files\q_year.csv @freq U 1
Then create a new date series (i named mine DT2) that uses our @dateval function to convert your date column string (my date string column was named DT) into an actual date, like this
(note the literal [Q] specified in the format string - this string is case sensitive so you must match it exactly to your date string):
Code: Select all
series dt2 = @dateval(dt, "[Q]Q YYYY")
Then finally use the pagestruct command to restructure your workfile to use the new date series as your frequency:
Once you have the workfile converted to the proper frequency, you can use the COPY command to put your new series objects into any pre-existing workfile that is already open.
To cleanup, you can simply close the workfile that was created during the import:
Steve