export statsby tables to a dbase

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

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

mark
Posts: 37
Joined: Thu Mar 12, 2009 3:27 pm

export statsby tables to a dbase

Postby mark » Tue Sep 15, 2015 10:19 am

Hi
Using EV9 enterprise
Issue - looping over a sample size of 300 projects to generate summary stats by each projects - I'd like to export vectors in each table to a common dbase.
I can export to csv files using the code below, however, given each project has varying attributes - the number of columns/rows vary across projects
I'm after the vectors in each project table and want to send them to a single dbase.
I've managed to store vectors to csv files and tables to the dbase, but I'm stumped as far as saving vectors in each table to dbase

here's the code:

transaction_amount.statby(nomean, sum, nostd, nocount) time business_function_code
freeze(p{%1}) transaction_amount.statby(nomean, sum, nostd, nocount) time business_function_code
'save the tables as csv files
p{%1}BF.save( t=csv, n="NAN") h:\planning and policy\CPS\LB_DUMP\p{%1}BF
'stores the TABLES to the dbase
store cps_sample::p{%1}BF

any ideas - thanks

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

Re: export statsby tables to a dbase

Postby EViews Gareth » Tue Sep 15, 2015 10:28 am

That should work. I assume that the database is an EViews database?

mark
Posts: 37
Joined: Thu Mar 12, 2009 3:27 pm

Re: export statsby tables to a dbase

Postby mark » Tue Sep 15, 2015 11:32 am

works for the stats summary tables

I want to save the fields and data elements from each table(s) to the dbase (not the tables)

Each table varies in dimension - the number and names of fields vary table to table (300 or so)

The complete set of field names is common to all ables but the the number and title of field names vary across all tables.

Ideas?
thanks

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

Re: export statsby tables to a dbase

Postby EViews Gareth » Tue Sep 15, 2015 11:41 am

Probably better of not using statsby, but rather calling the individual by functions (such as meansby). Those will return results in series objects, which can be stored to the database, or you can shrink them down to vectors.

mark
Posts: 37
Joined: Thu Mar 12, 2009 3:27 pm

Re: export statsby tables to a dbase

Postby mark » Tue Sep 15, 2015 11:48 am

thanks - big help
mark


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests