A 'Boolean' in a spreadsheet wrangling program refers to the ability to tag cell values with either TRUE or FALSE on the basis of meeting criteria that you specify. In the next exercise we'll set up a Boolean argument for the purpose of transforming the data that meets one of the criteria.
In the Splitting and Joining Cells part of this guide you learned that some of the cells in the Narrative_1 column of the sample dataset contain two values, a narrative portion and a diagnosis portion, which are separated by a double carat symbol (>>). We'll set up a Boolean argument to find exactly which cells throughout the spreadsheet contain this phenomenon.
As stated above, the Narrative_1 cells that have been isolated by the Boolean argument have two values. In this exercise, we'll format them as an array. An array is simply a list of values in a certain format. OpenRefine's array format is to list the values inside square brackets, with each value enclosed in quotation marks and separated by a comma. The result looks like this: ["dog","cat","fish","bird"].
Why would we want to list the two values in the faceted Narrative_1 cells in an array format? Because if we do, then the two values will be considered separate entities that we can make changes to. In the example below, we'll use a two-step process to flip the values, so the diagnosis will appear first.
The expression used above is a combination of a regular expression (contained within the / /, based on Java syntax) and a GREL expression (contained within the outer parentheses). It is not necessary to memorize these expressions. For hybrid regular-GREL expressions commonly used in OpenRefine, see the many OpenRefine recipes available on their official GitHub page.