I have a dataset like this, and I'm looking for a way to add a category, based on what kind of product I have.
Can I search for
Orange and assign them to a category named
Fruits, and similar with
Wine and assign them to another category, named
| Item | Category |
| Apple | | <-- Fruits
| Orange| | <-- Fruits
| Milk | | <-- Drinks
| Wine | | <-- Drinks
Or maybe a simpler method: find any rows containing
Milk and assign them to category
This is something you can do without code.
Itemfield for each value
editbutton next to the blank value in the
Categoryfacet and type with the category you want to add.
Itemfacet or filter to move to the next category and repeat this process until you have categorized all yours items.
As magdmartin says you can do this using facets and edits - the solution he describes is probably the simplest approach and least error prone. However, if you prefer to do in a single step you can use GREL to test the content of the Item cell and then set the value in the Category cell dependent on the content of the Item cell.
This is the same approach as given by Ettore Rizza above but in GREL rather than Jython.
magdmartin and Owen Stephens give good answers. Another simple way using GREL:
Edit column > Add column based on this column...
You could keep adding
.replace("whatever food","whatever category") ad nauseum