450 likes | 549 Views
Statistics 2 go. ( simplePXsql , PX2go and API). PC-Axis reference group, Tirana 2013. Lars Pedersen. Question:. How many persons are living in Greenland ? Look to: http://bank.stat.gl/beest1. Answer by a pc:. Answer by an iPad :. Answer by an iPhone:. Think off:. Motorola Storno
E N D
Statistics 2 go (simplePXsql, PX2go and API) PC-Axis reference group, Tirana 2013 Lars Pedersen
Question: How many persons areliving in Greenland ? Look to: http://bank.stat.gl/beest1
Think off: • Motorola Storno • Sony Ericsson • Nokia • and px-web 2008
Question: How many persons areliving in Greenland ? http://bank.stat.gl/beest1 http://bank.stat.gl/m.asp?m=beest1
Overview • a little history • from px-files to a database • what is that good for? • px2go • api’s • cliffhanger
the family concept • We need to stay connected • Meet, party and quarrel • a road-map
the family concept PX-web PC-Axis Create procedures PX-files ? Create procedures PC-Axis/sql Denmark Norway Ireland … DB Nordic Create procedures Create procedures
from px-files to a database Database specificsettings: [System] sql_database=statbank2013 sql_baseowner=.. sql_datestamp=Y-D-M h:m:00 sql_endline= sql_bulksave=1
from px-files to a database All can be done batch by a few lines in PX-JOB @echo off : Batch command line: : PX-Job.exe {job} [in] {out} {err} {def} {log} {-options} :PX-Job job=sql in=H:\database\test\ out=H:\database\test\ log=H:\database\test\pxjob1.txt err=H:\database\test\ -s -o1 -e1 PX-Job job=sql in=H:\database\test\ out=H:\database\test\ log=H:\database\test\pxjob1a.txt err=H:\database\test\ -s -o3 -e1
input approximately 650 px files normal tree structure
output with switch -s -o1 -e1 INSERT INTO statbank2013..PXTables VALUES('en','BEEST1','ANSI','2000','',null,'2010-22-03 09:00:00','2013-22-02 09:00:00','','','Annually','',null,null,0,null,null,'','','BE','Population','','',null,'Population January 1st by residence, gender, age and place of birth 1977-2013','','Population','Persons','','2013-22-02 09:00:00','','','','','Lars Pedersen, LARP@stat.gl',null,null,null,'Statistics Greenland','','',null,null,null,null,'','','','','','','','','',null,'','','',null,null,null) INSERT INTO statbank2013..PXVariables VALUES('en','BEEST1','time','1','R','','',null,'','',null,null,null,'','',null,'',null,null,'','') INSERT INTO statbank2013..PXValues VALUES('en','BEEST1','time','1','1977','1','',null,null,'','','','','',null,null,null,null,null,'',''),('en','BEEST1','time','1','1978','2','',null,null,'','','','','',null,null,null,null,null,'',''),('en','BEEST1','time','1','1979','3','',null,null,'','','','','',null,null,null,null,null,'',''),('en','BEEST1','time','1','1980','4','',null,null,'','','','','',null,null,null,null,null,'',''),('en','BEEST1','time','1','1981','5','',null,null,'','','','','',null,null,null,null,null,'',''),('en','BEEST1','time','1','1982','6','',null,null,'','','','','',null,null,null,null,null,'',''),('en','BEEST1','time','1','1983','7','',null,null,'','','','','',null,null,null,null,null,'',''),('en','BEEST1','time','1','1984','8','',null,null,'','','','','',null,null,null,null,null,'',''),('en','BEEST1','time','1','1985','9','',null,null,'','','','','',null,null,null,null,null,'',''),('en','BEEST1','time','1','1986','10','',null,null,'','','','','',null,null,null,null,null,'',''),('en','BEEST1','time','1','1987','11','',null,null,'','','','','',null,null,null,null,null,'',''),('en','BEEST1','time','1','1988','12','',null,null,'','','','','',null,null,null,null,null,'',''),('en','BEEST1','time','1','1989','13','',null,null,'','','','','',null,null,null,null,null,'',''),('en','BEEST1','time','1','1990','14','',null,null,'','','','','',null,null,null,null,null,'',''),('en','BEEST1','time','1','1991','15','',null,null,'','','','','',null,null,null,null,null,'',''),
output with switch -s –o3 -e1 Converts our 574 Mb px-files to tab-separated csv-files in less than 1 hour
transfer script (load all) Empty database (drop ifexsist) Create 3 tables (tables, variables and values) Loop though the px-files set metafile=objf.opentextfile(f.name) uttext= metafile.readall metafile.close adoConn.executeuttext set metafile=nothing Createtable for data by use of newlyaddedmeta Createinsert statement for data BULK INSERT statbank2013..PXData_NRE13 FROM 'G:\web\database\Greenland\National accounts\NRE13_data.sql' WITH (CODEPAGE = 'ACP',FIELDTERMINATOR='\t',ROWTERMINATOR='\n')
what is that good for : • a dirty px-file datacollection • Used for cleansing • queries across tables • translation services • bridge to the nordic model ?
connections PX-web PC-Axis PX-Edit Create procedures PX-files simplePXsql Create procedures PC-Axis/sql Denmark Norway Ireland … Create procedures DB Nordic Create procedures
px2go • http://bank.stat.gl/m.asp • Find table • a link (http://bank.stat.gl/m.asp?m=beest1) • category • search • Tableselected • knownselection • unknownselection
s… happens • Greenland Tourism ( www.tourismstat.gl ) • automatic updated from our statbank • api
http://json-stat.org • Graph • Table • Pyramid • Bubles
re-doing px2go for json-stat matrix generate Json-stat showcube Graph explore getmeta Table API getdefault Json-stat csv
cliffhanger • groupings • production