Page 1 of 1

Automatic date selection from Excel import

Posted: Fri Dec 12, 2025 1:42 pm
by justincn
Hello everyone,

Is it possible to import an Excel file without having to hardcode the start date? For example, if I have the following code

Code: Select all

import(page=DATA) %data range ="Sheet1" @freq q 1980

My question is this: Is there a way to get around having to add 1980 and automatically detect the start and end dates of the sheet?

For reference, the data looks like this (note the second and third series begin in 1990)

Code: Select all

quarter sales laborforce household Q1-80 813038 Q2-80 795216 Q3-80 815587 Q4-80 850848 Q1-81 856297 Q2-81 902501 Q3-81 899384 Q4-81 890007

Re: Automatic date selection from Excel import

Posted: Sun Dec 14, 2025 3:17 pm
by EViews Gareth
Not with the non-standard date format you have. If the dates are written in a standard format, EViews will generally interpret it just fine.

A possible work around would be to import the file into a new EViews page, completely undated, then create a date series based on the date format you are using, and then copy from that new page to your actual destination page.

Re: Automatic date selection from Excel import

Posted: Mon Dec 15, 2025 9:49 am
by justincn
Thanks, Gareth.

Is there a standard format that would work quarterly dates?

1980Q1? 1980-Q1? etc.

Re: Automatic date selection from Excel import

Posted: Mon Dec 15, 2025 11:44 am
by EViews Gareth
1980Q1 should work. But also just the date of the first day of the quarter.

Re: Automatic date selection from Excel import

Posted: Mon Dec 15, 2025 11:59 am
by EViews Gareth
You could also probably get away with this, with your initial format:

Code: Select all

import(page=data) %data @id @date(@dateval(quarter,"[Q]Q[-]YY")) @destid @date

Re: Automatic date selection from Excel import

Posted: Mon Dec 15, 2025 2:19 pm
by justincn
Thanks, Gareth!