Skip to content

Instantly share code, notes, and snippets.

@talllguy
Last active January 4, 2016 02:09
Show Gist options
  • Save talllguy/8553231 to your computer and use it in GitHub Desktop.
Save talllguy/8553231 to your computer and use it in GitHub Desktop.
handy OpenRefine functions for Baltimore City Arrests data mapping

Convert dates to ISO 8601

value.toDate('mm/dd/yyyy').toString('yyyy-mm-dd')

Combine date / time columns

cells["arrestDate"].value + "T" + cells["arrestTime"].value + ":00-05:00"

Capitalize CDS abbrieve

value.replace('Cds','CDS')

Filter nulls out in CartoDB

SELECT * FROM bpd_arrests_talk_1 WHERE (incidentoffense_1 IS NOT NULL)

Filter white females

SELECT * FROM bpd_arrests_talk_1 WHERE sex IN ('F') AND race IN ('W')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment