Page 1 of 1

working with data from SQL database

Posted: Fri May 01, 2020 12:59 pm
by BT454
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 409 times

Re: working with data from SQL database

Posted: Fri May 01, 2020 8:46 pm
by EViews Gareth
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)

Re: working with data from SQL database

Posted: Thu May 07, 2020 6:49 am
by BT454
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?

Re: working with data from SQL database

Posted: Thu May 07, 2020 7:42 am
by EViews Gareth
Isn't that the pooled form?

Re: working with data from SQL database

Posted: Thu May 07, 2020 8:04 am
by BT454
You are correct! My fault. thanks again!