Skip to content

Rename column filter

David Megginson edited this page Mar 7, 2020 · 3 revisions
Rename column filter form

The Rename column filter on the Recipe page allows you to change the hashtag and header text for columns that match a tag pattern.

This filter is especially common after complex filters like the Count rows filter or Explode data filter, for cleaning up the newly-generated columns.

Options

Original tag or pattern: (required) the tag pattern for the column to rename. The HXL Proxy will rename all matching columns.

Choose only columns with this header: in addition to filtering on the tag pattern, also filter by text header (case- and whitespace-insensitive).

New tag: (required) the new hashtag and attributes to use for the column.

New display header: the new text header to show above the hashtag. If omitted, keep the existing header.

Example

Original data

#org #sector #adm1+name #adm1+code #targeted
UNICEF Education Coast X001 5000
Save the Children Education Plains X002 300
IOM CCCM Coast X001 1500
UNICEF Protection Plains X002 8000

Renamed data

Rename #targeted to #affected:

#org #sector #adm1+name #adm1+code #targeted
UNICEF Education Coast X001 5000
Save the Children Education Plains X002 300
IOM CCCM Coast X001 1500
UNICEF Protection Plains X002 8000

Use cases

As mentioned earlier, this filter is useful for cleaning up after a series of complex transformations, to change the headers and hashtags on newly-generated columns. Use especially after filters like the Count rows filter, Explode data filter, and Merge columns filter.

If different data providers use slightly-different conventions, you can use this filter to standardise their hashtags. For example, you could change "#sector" to "#sector+cluster" for consistency.

You can also use this filter to change the language of text headers. For example, you replace "#adm1+name" with itself, but add the text header "Provincia" to replace the original "Province".

For coders

The equivalent for this filter in JSON recipes is rename_columns, which allows you to rename multiple columns in a single operation.

Clone this wiki locally