Friday, January 25, 2019

Recipe: Using filters to identify all the blank columns in a spreadsheet

Rachel had an interesting problem for me - she had a spreadsheet with a plethora of columns. Some had information, and some were blank. It was tedious trying to use faceting to identify the blank columns, so she wondered if there was a way to quickly identify them in Open Refine.

The answer is quite simple, first identify how many total rows you have on your spreadsheet. Then, go to any column in Open Refine.

Then do facet->custom text facet.

In the box, enter the following GREL:
 filter(row.columnNames,cn,isBlank(cells[cn].value)) 

This will make a facet out of each column, with the number of blank rows listed to the right:
countup.PNG
There are 414 rows total on this spreadsheet, so any column with "414" next to it is completely blank.