Skip to content

Commit

Permalink
Create 02 - Retrieve Script.qvs
Browse files Browse the repository at this point in the history
  • Loading branch information
cleveranjos committed Jan 28, 2019
1 parent 9c55e48 commit 3eddae9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Chapter11/02 - Retrieve Script.qvs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
LIB CONNECT TO 'Google_BigQuery';
NYC_Bike_trips:
load
date(trip_month) as trip_month
,line_counter
,start_station_name
,end_station_name
,tripduration
,trips;
sql
SELECT
TIMESTAMP_TRUNC(starttime, month) AS trip_month
,start_station_name
,end_station_name
,sum(tripduration) AS tripduration
,count(starttime) AS trips
,sum(1) as line_counter
FROM `bigquery-public-data.new_york.citibike_trips`
GROUP BY
TIMESTAMP_TRUNC(starttime, month)
,start_station_name
,end_station_name;

0 comments on commit 3eddae9

Please sign in to comment.