import time series from tables stored in yearly Excel sheets

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

T8SCH
Posts: 4
Joined: Tue Feb 03, 2015 9:19 am

import time series from tables stored in yearly Excel sheets

Postby T8SCH » Tue Jan 12, 2021 2:09 am

Hi,

I have data with the following dimensions: time * activity * product.

The source Excel file is structured as follows (see attachment): for each year we have a sheet containing a table with activity identifiers in lines and product identifiers in columns.

I want to end up with a time series workfile and "pool" series, i.e. named "activity_product".

What is the most efficient way to program this import statement?

I couldn't find such an example in the user guide or forum. Thanks in advance for your help!

nb: i'm using EViews 11 Enterprise edition but we will switch to EViews 12 soon
Attachments
Data_subset.xlsx
(137.51 KiB) Downloaded 6 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 12694
Joined: Tue Sep 16, 2008 5:38 pm

Re: import time series from tables stored in yearly Excel sheets

Postby EViews Gareth » Tue Jan 12, 2021 10:02 am

Code: Select all

close @wf
wfcreate(page=master) u 1
for !i=2008 to 2018
   pageload(page=!i) data_subset.xlsx range={!i}!$E$6:$I$14 colhead=2 namepos=custom colheadnames=("Name","Description")
   rename series01 activity
   activity = @makevalidname(activity)
   series date = !i
   pageselect master
   pageappend {!i}
   pagedelete {!i}
next
pagecontract if date<>na
pageunstack(page=timeseries, namepat=?_*) activity date @ *
pagestruct @date(date)
Follow us on Twitter @IHSEViews

T8SCH
Posts: 4
Joined: Tue Feb 03, 2015 9:19 am

Re: import time series from tables stored in yearly Excel sheets

Postby T8SCH » Fri Jan 15, 2021 5:06 am

amazing, thanks a lot Gareth!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 9 guests