Ship It!
Buy or Subscribe
You can access this course in just a minute, and support my efforts to rid the world of crappy online courses!
Our analysts are going to be using Excel to dig into the data so let's setup a simple way to get it to them. We can run a script for this or we can use psql
:
psql cassini -c "\copy (select * from enceladus.results_per_flyby) to '//FILESHARE/results_per_flyby.csv' header csv;
Running a SQL script can be easier, and also a bit more flexible. The first command will output the results of our analysis view (rollups by flyby). The second will dump the overall result:
set search_path='enceladus';
copy (select * from enceladus.results_per_flyby)
to '//share/results_per_flyby.csv' header csv;
copy (select
inms.source,
chemistry.name as compound,
chemistry.formula,
sum(inms.high_sensitivity_count) as sum_high,
sum(inms.low_sensitivity_count) as sum_low
from flybys
inner join inms on flyby_id = flybys.id
inner join chemistry on chemistry.molecular_weight = inms.mass
group by inms.source, chemistry.name, chemistry.formula)
to '//share/overall_results.csv' header csv;
And that's it!