working with data from SQL database

For questions regarding programming in the EViews programming language.

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

BT454
Posts: 139
Joined: Wed Aug 02, 2017 6:07 am

working with data from SQL database

Postby BT454 » Fri May 01, 2020 12:59 pm

Hi all,
I'm working with some data from a sql server. I use the pageload command to query the sql database, and successfully import the data into eviews. It correctly imports the data by column. The database i'm pulling from is a relational database, and I would like to manipulate this data into time series. The three columns it imports are the date, region_id (identifier for a geography), and the actual value of the series. Is there a way to somehow merge this data together to create a time series for each region_id?
I've attached a workfile with sample data.
Thanks!
Bob
sql_sample.WF1
(53.85 KiB) Downloaded 408 times

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

Re: working with data from SQL database

Postby EViews Gareth » Fri May 01, 2020 8:46 pm

If you want a pooled workfile:

Code: Select all

series date = @dateval(manualweeklystorage_endingdate, "YYYY-MM-DD") pageunstack(namepat=*?) region_id date @ *
If you want a panel workfile:

Code: Select all

series date = @dateval(manualweeklystorage_endingdate, "YYYY-MM-DD") pagestruct region_id @date(date)

BT454
Posts: 139
Joined: Wed Aug 02, 2017 6:07 am

Re: working with data from SQL database

Postby BT454 » Thu May 07, 2020 6:49 am

Thank you for you reply!
Is there a way I can take the output from the pagestruct command and create a time series for each region ID, showing the value, by date?

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

Re: working with data from SQL database

Postby EViews Gareth » Thu May 07, 2020 7:42 am

Isn't that the pooled form?

BT454
Posts: 139
Joined: Wed Aug 02, 2017 6:07 am

Re: working with data from SQL database

Postby BT454 » Thu May 07, 2020 8:04 am

You are correct! My fault. thanks again!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests