Skip to content

Implode data filter

David Megginson edited this page Mar 16, 2020 · 2 revisions
Implode data filter form

The Explode data filter on the Recipe page allows you to denormalise a narrow dataset to a wide dataset, similar to the "reshape" command in the R language. For background information, see the Wikipedia article "Wide and narrow data."

You designate one column for the labels (that will appear as headers), and a second column for the values. The filter will take all rows where everything other than those two columns are the same, and make them into a single row, with a new column for each unique label.

(This is easier to understand by looking at the example below)

Options

Labels column: the HXL tag pattern matching the column containing the labels.

Values column: the HXL tag pattern matching the column containing the values.

Note that only one labels column and one values column is allowed. The Proxy will ignore any additional matches.

Example

Labels column: #date+year

Values column: #inneed

Before (narrow data)

District Year People in need
#adm1 #date+year #inneed
Coast 2010 5000
Coast 2011 6000
Coast 2012 6000
Coast 2013 2500
Coast 2014 1500
Coast 2015 1000
Plains 2010 0
Plains 2011 0
Plains 2012 1000
Plains 2013 8000
Plains 2014 10000
Plains 2015 12000

After (wide data)

District 2010 2011 2012 2013 2014 2015
#adm1 #inneed+label #inneed+label #inneed+label #inneed+label #inneed+label #inneed+label
Coast 5000 6000 6000 2500 1500 1000
Plains 0 0 1000 8000 10000 12000

Use cases

This filter is especially useful for taking data that has been optimised for machine readability (normalised) and converting it to a format that's more suitable for human readers (denormalised).

Clone this wiki locally