Hi.
I have a quarterly dated data in excel file to upload. I realized that Eviews 7 seems not to recognize quarterly data
when the format of date is in the form of " Q1 1995". Instead of recognizing the first colume as date series, the program
creates a seperate series in the workfile called "name".
How can I solve this problem by letting eviews recognize the first colume as date? Can I specify it in the wfopen command I use?
I didn't find any options from the command book.
Unfortunately I can not change anything in the source excel file due to limitation of macros in excel.
Thank you in advance for your idea.
problem in uploading quarterly series.
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: problem in uploading quarterly series.
Once you've brought it in with wfopen, you can use pagestruct to structure it properly. It isn't particularly clear from your post how it is currently ending up after bringing it in, but suppose you are left with a series (called YEAR) containing the year, and an alpha series, (called QUARTER) containing the quarter (something like "Q1", "Q2") etc..., then the following code will work:
Code: Select all
series q = @val(@right(QUARTER,1)) 'convert the alpha series into a numerical series containing the quarter number
pagestruct @date(year,q) 'convert the page into a quarterly page.
Re: problem in uploading quarterly series.
Thank you Gareth for your reply.
Actually the whole problem is very interesting to me. I use wfopen command to open a datasheet from excel. And then I rename the series in the wf and
store them to db. The interesting part is that after the renaming commands are finished, I click the series in the workfile, and the series displays well, each of the observations being associated with proper date. But when I click the exact series that is saved in the db, it is not dated! and the frequency of these series is shown as"U".
Right now the series in the db has no date, the id of each observation is from 1 to 1500 (say the series has 1500 observations). I use the same method to upload series
of other frequencies and such thing never happens. I've spent days trying to find out what's wrong but can't find anything. Can you maybe tell me what could be wrong?
I can upload the program and datasheet if it helps.
Thank you so much again for your help.
Actually the whole problem is very interesting to me. I use wfopen command to open a datasheet from excel. And then I rename the series in the wf and
store them to db. The interesting part is that after the renaming commands are finished, I click the series in the workfile, and the series displays well, each of the observations being associated with proper date. But when I click the exact series that is saved in the db, it is not dated! and the frequency of these series is shown as"U".
Right now the series in the db has no date, the id of each observation is from 1 to 1500 (say the series has 1500 observations). I use the same method to upload series
of other frequencies and such thing never happens. I've spent days trying to find out what's wrong but can't find anything. Can you maybe tell me what could be wrong?
I can upload the program and datasheet if it helps.
Thank you so much again for your help.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: problem in uploading quarterly series.
Uploading the program and data would be useful, thanks.
Re: problem in uploading quarterly series.
Thank you Gareth.
I have attached both the prg file and excel here for your reference. There needs some slight changes in the program.
1. the path is c:\users\liu\desktop\excel1.xlsx.
2. I have three db called eco, currency and test, which this program is working on.
I have attached both the prg file and excel here for your reference. There needs some slight changes in the program.
1. the path is c:\users\liu\desktop\excel1.xlsx.
2. I have three db called eco, currency and test, which this program is working on.
- Attachments
-
- question.prg
- the program
- (6.63 KiB) Downloaded 403 times
-
EViews Jason
- EViews Developer
- Posts: 870
- Joined: Tue Sep 16, 2008 3:50 pm
Re: problem in uploading quarterly series.
The problem is EViews does not recognize the first column on 'sheet22' as being dates. Q[Q] YYYY(ex. Q1 1950) is an unorthodox date format. Because it is unrecognized, EViews is creating an undated workfile with an ID series.
To get what you want, change your command to:
To get what you want, change your command to:
Code: Select all
wfopen(page=x) "C:\excel1.xlsx" colhead=2, range="sheet22" namepos=last @id @date(@dateval(code,"[Q]Q YYYY"))
Re: problem in uploading quarterly series.
Thank you Jason. I tried your code and it totally worked. (I didn't understand though why in your code it is ,"[Q]Q YYYY")) instead of Q[Q] YYYY. )
However, I have another file, which is very normally dated as dd/mm/yyyy, just as other excel files I have. When I uploade it, it gives the same problem, that the first date colume is not recognized. Can you help me take a look at it and tell me what most likely the reason is?
This is because similar problem happens to my work when I import data from a variety of sources.
The command I used to open it is:
wfopen(page=x) "c:\users\liu\desktop\excel2.xlsx" colhead=2, range="sheet5" namepos=last
However, I have another file, which is very normally dated as dd/mm/yyyy, just as other excel files I have. When I uploade it, it gives the same problem, that the first date colume is not recognized. Can you help me take a look at it and tell me what most likely the reason is?
This is because similar problem happens to my work when I import data from a variety of sources.
The command I used to open it is:
wfopen(page=x) "c:\users\liu\desktop\excel2.xlsx" colhead=2, range="sheet5" namepos=last
- Attachments
-
- excel2.xlsx
- Excel file for data
- (22.28 KiB) Downloaded 412 times
-
EViews Jason
- EViews Developer
- Posts: 870
- Joined: Tue Sep 16, 2008 3:50 pm
Re: problem in uploading quarterly series.
I mistyped in my previous post, it should have read '[Q]Q YYYY(ex. Q1 1950)'.
In the second excel file, while there are valid dates EViews is unclear as to what the correct frequency should be (daily or annual). Had the dates been
1/1/1950
1/1/1951
1/1/1952
...
instead of
6/30/1950
6/30/1951
6/30/1952
...
EViews would have chosen annual.
After the workfile has been created you can do one of the following
or
In the second excel file, while there are valid dates EViews is unclear as to what the correct frequency should be (daily or annual). Had the dates been
1/1/1950
1/1/1951
1/1/1952
...
instead of
6/30/1950
6/30/1951
6/30/1952
...
EViews would have chosen annual.
After the workfile has been created you can do one of the following
Code: Select all
pagestruct(freq=a) @date(code) 'restructure to an annual workfileCode: Select all
pagestruct(freq=7,reg) @date(code) 'restructure to a 7 day daily workfileWho is online
Users browsing this forum: No registered users and 2 guests
