Hi - I am trying to import data from excel using a program rather than the import menu command and I want to tell eviews that I have three column headers and the first line contains series names. Here's what I have so far:
import %fname range="employment" colhead=3
where %fname is the name of my file. The data comes in fine but the name is all three headers rather than name, label. Data looks like this:
EEL72DC
Employment, Accommodation and Food Services, By Place of Work NAICS
REG_MTH_HIST:EEL72DC.M
1982M1 12
1982m2 15
...
any help is most appreciated.
import xls with labels
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
Re: import xls with labels
Sorry. I'm using Eviews 7
-
- EViews Developer
- Posts: 2672
- Joined: Wed Oct 15, 2008 9:17 am
Re: import xls with labels
Where does your "employment" range start?
Re: import xls with labels
"employment" refers to the worksheet name. My understanding is that the import command does not necessarily need a defined range.
I know I could make it easy on myself by using the read command but I want the labels as well as the series names.
Thanks,
Norton
I know I could make it easy on myself by using the read command but I want the labels as well as the series names.
Thanks,
Norton
Re: import xls with labels
I once had the similar problem and one of the Eviews professionals here showed me the code.
It's an wfopen command as below.
wfopen(d=pagename) "C:\desktop\yourexcelfile.xls" colhead=1, range="sheet1" namepos=last
Notice that colhead doesn't clarify how many column header you have but which line you want to use as series names. if colhead=3 then that means
the third line stores the series names and the rest will go to "descriptions".
Just for your reference. Hope Eviews dudes confirm it.
It's an wfopen command as below.
wfopen(d=pagename) "C:\desktop\yourexcelfile.xls" colhead=1, range="sheet1" namepos=last
Notice that colhead doesn't clarify how many column header you have but which line you want to use as series names. if colhead=3 then that means
the third line stores the series names and the rest will go to "descriptions".
Just for your reference. Hope Eviews dudes confirm it.
Re: import xls with labels
Great! I used namepos=first and got my series names and my labels.
Thanks for the help.
Thanks for the help.
Re: import xls with labels
correction. i just looked at the data and I got the series name and the third line of the column header as the label. My problem is that the third line is a query line and I can't put a line in between that and the data.
So this command: import %fname range="employment" colhead=3 namepos=first
for this data:
EEL72DC
Employment, Accommodation and Food Services, By Place of Work NAICS
REG_MTH_HIST:EEL72DC.M
1982M1 #N/A
1982M2 #N/A
1982M3 #N/A
1982M4 #N/A
gets me a series named EEL72DC with a label of REG_MTH_HIST:EEL72DC.M
when I want a series named EEL72DC with a label of "Employment, Accommodation and Food Services, By Place of Work NAICS"
So this command: import %fname range="employment" colhead=3 namepos=first
for this data:
EEL72DC
Employment, Accommodation and Food Services, By Place of Work NAICS
REG_MTH_HIST:EEL72DC.M
1982M1 #N/A
1982M2 #N/A
1982M3 #N/A
1982M4 #N/A
gets me a series named EEL72DC with a label of REG_MTH_HIST:EEL72DC.M
when I want a series named EEL72DC with a label of "Employment, Accommodation and Food Services, By Place of Work NAICS"
-
- EViews Developer
- Posts: 870
- Joined: Tue Sep 16, 2008 3:50 pm
Re: import xls with labels
Using the exact data and command you posted, I was able to get a series named EEL72DC with the description equal to "Employment, Accommodation and Food Services, By Place of Work NAICS REG_MTH_HIST:EEL72DC.M" as one line. I believe this is what you wanted.
Please make sure you have the latest version of EViews (select Help->EViews update).
Please make sure you have the latest version of EViews (select Help->EViews update).
Who is online
Users browsing this forum: No registered users and 9 guests