fetching and converting at the same time

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

fetching and converting at the same time

Postby miorinnovo » Mon Apr 03, 2017 2:32 pm

When I fetch a monthly series form a database into an annual workpage the conversion automatically is done by summing. How do I fetch it and have it average instead?

Thanks

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

Re: fetching and converting at the same time

Postby EViews Gareth » Mon Apr 03, 2017 2:36 pm

Follow us on Twitter @IHSEViews

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: fetching and converting at the same time

Postby miorinnovo » Tue Apr 04, 2017 7:54 am

Thanks

I'm using c=a to convert quarterly to annual, but an odd thing is happening. The last data available right now is 2017Q1, and its averaging the years going from Q2 to Q1 instead of the regular calendar year.

Any idea why or how to fix?

Thanks

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

Re: fetching and converting at the same time

Postby EViews Gareth » Tue Apr 04, 2017 8:52 am

Could you provide the files?
Follow us on Twitter @IHSEViews

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: fetching and converting at the same time

Postby miorinnovo » Tue Apr 04, 2017 10:24 am

Well I'm fetching form an internal database but the relevant code is just the following:

Code: Select all

smpl 1981 2016
fetch(d=database, c=a) variablename


EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: fetching and converting at the same time

Postby EViews Jason » Tue Apr 04, 2017 12:08 pm

I am not seeing the described behavior. We are going to need more information.

Please post or send the files or screenshots to support@eviews.com.

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: fetching and converting at the same time

Postby miorinnovo » Tue Apr 04, 2017 1:36 pm

When I import the quarter data into a quarterly page I get:

Code: Select all

2016Q1   529506
2016Q2   529667
2016Q3   530128
2016Q4   530376
2017Q1   529696


But when I use the following code to import into an annual page

Code: Select all

smpl 1981 2016
fetch(d=database, c=a) variablename


I get

Code: Select all

2015   529043.75
2016   529966.75


If you calculate the average of 2016Q2 to 2017Q1 you get the number in for 2016 in the annual page.

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: fetching and converting at the same time

Postby miorinnovo » Tue Apr 04, 2017 2:38 pm

I was able to work around the problem by importing the data into a quarterly page and then copying it over to the annual page.

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: fetching and converting at the same time

Postby EViews Jason » Tue Apr 04, 2017 2:41 pm

How is your workfile structured? If you double click "Range" in the workfile window, a dialog will appear. Please post a screenshot of that workfile.

Secondly if you open the database and double click the series you are fetching, a preview window containing meta information about the series should appear. Please post a screenshot of that as well. I would like to see the frequency and start and end dates of the series.

Thirdly, also make sure your copy of EViews is up to date. Select help->EViews update to obtain the latest version.

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: fetching and converting at the same time

Postby miorinnovo » Wed Apr 05, 2017 6:52 am

1- The workfile structure is annual 1961-2017
2- I'm not sure how to open the database
3- My version is 9.5 January 7 2016 build

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: fetching and converting at the same time

Postby EViews Jason » Wed Apr 05, 2017 1:26 pm

Can you update your copy? You are using a version more than a year old.

If the problem persists after updating, I will need a copy of your database. Please send to support@eviews.com


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 50 guests