Case study · Google Data Analytics

Analysing bike-share trip data

A bike-share company’s question: how do annual members and casual riders use the bikes differently, so marketing can turn casual riders into members.

Tools
R, SQL Server, Excel
Data
12 months of trips
Role
Solo project
A row of blue Divvy bike-share bikes docked at a station on a Chicago sidewalk
A Divvy station in Chicago, the source of the data. Photo: Eric Fischer, CC BY 2.0

The question, the method and the result

  • The question

    Compare annual members with casual riders: bike type, trip length, peak hours, weekdays and starting locations.

  • The method

    Merged and trimmed 12 monthly files in R, cleaned the data and built analysis columns in T-SQL, then summarised with Power Query and pivot tables in Excel.

  • The result

    An Excel dashboard comparing the two groups, six key findings and four proposals for a campaign to convert casual riders.

Excel dashboard with trips by bike type, by hour, by weekday and by location

Step by step

Background

This is the capstone of the Google Data Analytics programme. Cyclistic is a fictional bike-share company in Chicago, but the data analysed is real trip data from the Divvy system.

Finance found that annual members are much more profitable than casual riders, so leadership believes growing the number of annual members is the key to growth. Marketing needs to understand how the two groups differ before designing a campaign.

  • Casual riders: buy a single-ride or a full-day pass.
  • Members: buy an annual membership.

Business task

Identify how annual members and casual riders use Cyclistic bikes differently, to optimise marketing aimed at what characterises casual riders.

The dataset

  • Scope: the previous 12 months of trip data, March 2022 to February 2023, one CSV file per month.
  • First-party data stored in the company’s cloud; historical and structured.
  • Made available by Motivate International Inc. under a public licence.
  • Meets the ROCCC standard: reliable, original, comprehensive, current and cited.
Description of the variables (column names) in the dataset.
ColumnDescriptionType
ride_idID of each tripCharacter
rideable_typeType of bike used, one of 3: classic, electric and dockedCharacter
started_atDate and time the trip started (CST)Date and time
ended_atDate and time the trip ended (CST)Date and time
start_station_nameName of the start stationCharacter
start_station_idID of the start stationCharacter
end_station_nameName of the end stationCharacter
end_station_idID of the end stationCharacter
start_latLatitude of the start stationNumeric
start_lngLongitude of the start stationNumeric
end_latLatitude of the end stationNumeric
end_lngLongitude of the end stationNumeric
member_casualcasual: a rider who bought a 24-hour pass; member: a rider with an annual membershipCharacter

Preparing the data in R

  1. Merged the 12 CSV files into one table.
  2. Removed duplicate rows.
  3. Kept only the columns needed, to cut the file size: member_casual, rideable_type, started_at, ended_at, start_station_name.
  4. Exported a new CSV file for SQL Server.

Cleaning the data in SQL Server

Wrote T-SQL to build the analysis columns and drop invalid rows, following the cleaning plan below. The output is Cyclistic_clean_v4.csv for the analysis step.

The cleaning plan: which columns to keep, how to derive them and how to check integrity.
ColumnActionDescriptionIntegrity check
member_casualAvailablecasual: a rider who bought a 24-hour pass; member: a rider with an annual membershipOnly 2 values: casual, member
rideable_typeAvailableThe type of bike used: classic, electric or dockedOnly 3 values: classic_bike, electric_bike, docked_bike
trip_durationSeconds from started_at to ended_atTrip length in secondsKeep trips of 2 minutes or more (trip_duration >= 120); find and drop outliers longer than 1 day
start_hourHour of started_atThe hour the trip startedBetween 0 and 23
day_of_weekWeekday of started_atThe day of the week of the tripMonday to Sunday
start_locationSplit start_station_name (an intersection) into 2 columns, keep the first as the main location (road, avenue, university…) and drop blank rowsWhere the trip startedMany locations, no blanks (thanks to the previous step)

Analysing in Excel

Loaded the cleaned file with Power Query and built a pivot table for each question:

  • A cross table and side-by-side bar chart: how often each group uses each bike type.
  • Average trip duration in hh:mm:ss.
  • Trips by weekday and by start hour.
  • Locations where casual riders outnumber members: a helper column “casual − member”, filtered above 0 and sorted by total trips, largest first.
Summary tables of trips by bike type, by day and by location
Stats tables.
Excel dashboard comparing members and casual riders
Dashboard comparing the two groups.

Key findings

  • Casual riders rarely use docked bikes, and members never do.
  • Casual riders use classic and electric bikes equally; members clearly prefer classic bikes.
  • Casual riders’ average trip is twice as long as members’: they already know Cyclistic and choose it for getting around.
  • Casual riders ride mostly at weekends (Saturday and Sunday), members mostly on workdays.
  • Both groups share the same daily rhythm: rising in the morning, peaking in the afternoon, falling at night. Members alone jump at 6–8 am and 4–6 pm, matching commuting hours.
  • Many busy locations still have a casual majority. The ten busiest: Michigan Avenue, DuSable Lake Shore Drive, Streeter Drive, Millennium Park, Theater on the Lake, Shedd Aquarium, Montrose Harbor, DuSable Harbor, Adler Planetarium, Lincoln Park Conservatory.

Recommendations

  1. Offer a discount or a 5-day trial card (Monday to Friday) for classic bikes, so casual riders feel the convenience of cycling to school or work during the week.
  2. Focus marketing on weekends and at attractions, when casual riders ride most and longest.
  3. Concentrate the budget on the ten locations above, ideally right at the Cyclistic stations to keep costs down.
  4. Run activities between noon and 7 pm to reach the most casual riders.