Hello,
I would like to create a table and fill it with values that are collected from different work files i.e. I will have a loop opening a series of files and copying these values into a table.
Could you help me how to do it.
Thanks a lot
A table filled with values from different workfiles
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: A table filled with values from different workfiles
Open the workfiles one at a time with the wfopen command, make a table containing the information you want, then copy the tables over to a master workfile with the copy command. Finally, merge the tables into one table with copytable or copyrange.
Re: A table filled with values from different workfiles
Sorry, it may sound stupid, I couldn't manage to copy the tables into a master workfile. How can I create a master workfile where only the tables will be copied to. That was my problem, earlier, I kept getting error messages when I wrote the copy command.
thanks a lot
thanks a lot
Re: A table filled with values from different workfiles
Here is my code but I receive an error message: " database not found" tables.edb does not exist.
wfcreate(wf=tables, page=table) u 1000
wfsave tables
close tables.wf1
for %f AUS BRA CAN CHL IND KOR MEX NOR NZL ZAR
wfopen {%f}.wf1
copy bic_{%f} tables::table\bic_{%f}
next
wfcreate(wf=tables, page=table) u 1000
wfsave tables
close tables.wf1
for %f AUS BRA CAN CHL IND KOR MEX NOR NZL ZAR
wfopen {%f}.wf1
copy bic_{%f} tables::table\bic_{%f}
next
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: A table filled with values from different workfiles
Don't close the tables workfile.
Re: A table filled with values from different workfiles
It worked, thanks a lot! I have another question. Is copytable or copyrange available in version 7? I cannot find the command in Eviews 6 help.
have a great day
have a great day
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: A table filled with values from different workfiles
Only in EViews 7 or 8.
copytable command
hello,
I want to increment the row number in the copytable command as below, but it doesn't seem to be working. I think an exact number is required.
Thanks
table for_all
scalar i=1
for %f AUS BRA CAN CHL IND KOR MEX NOR NZL ZAR
for_{%f}.copytable for_all i 1
i=i+8
next
I want to increment the row number in the copytable command as below, but it doesn't seem to be working. I think an exact number is required.
Thanks
table for_all
scalar i=1
for %f AUS BRA CAN CHL IND KOR MEX NOR NZL ZAR
for_{%f}.copytable for_all i 1
i=i+8
next
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: A table filled with values from different workfiles
Try:
Code: Select all
table for_all
scalar i=1
for %f AUS BRA CAN CHL IND KOR MEX NOR NZL ZAR
for_{%f}.copytable for_all {i} 1
i=i+8
next
Re: A table filled with values from different workfiles
thanks a lot. It worked.
Re: A table filled with values from different workfiles
Hi there!
May I please ask for your help. I tried replicating the code below to merge several tables in a single table in a workfile. however, it is giving me an error: "Result_arm is not defined in "do_result_arm.copytable for_all 1 1". I used the code:
table for_all
scalar i=1
for %f arm aze ban geo
result_{%f}.copytable for_all {i} 1
i=i+4
next
Each table is 3x3.
I dunno how to resolve this issue.
thanks
May I please ask for your help. I tried replicating the code below to merge several tables in a single table in a workfile. however, it is giving me an error: "Result_arm is not defined in "do_result_arm.copytable for_all 1 1". I used the code:
table for_all
scalar i=1
for %f arm aze ban geo
result_{%f}.copytable for_all {i} 1
i=i+4
next
Each table is 3x3.
I dunno how to resolve this issue.
thanks
Who is online
Users browsing this forum: No registered users and 1 guest
