Splitter.SplitByNothing
Returns a splitter that does not split at all: the whole text stays as one piece.
Splitter.SplitByNothing()Returns: A function that returns the text as a single item in a list.
What it does
Splitter.SplitByNothing is the "do not split" choice. It is the default for functions that take a splitter, such as Table.FromList, where it means each item in the list becomes one row in one column. Use it to turn a simple list into a single-column table.
Syntax and arguments
- This function takes no arguments. It is written with empty brackets:
Splitter.SplitByNothing().
Example
A list of approved vendor names needs to become a one-column table so that it can be merged with the vendor master.
let
ApprovedVendors = {"Acme Supply", "Bolt Hardware", "Crane Services"},
AsTable = Table.FromList(ApprovedVendors, Splitter.SplitByNothing(), {"Vendor"})
in
AsTable
AsTable has three rows and one column called Vendor, one vendor per row. The names are not split at any point, even though they contain spaces.
Example: a second, different use
Keeping a text value whole inside a split step, for example when only some values in a column should be cut and others kept as they are.
Things to watch
- It is the right choice for a list of simple values. If you want a column of text cut into parts, use one of the other splitters.
- Table.FromList uses this as its default in many cases, but naming it makes the intent clear to the next reader.
- The result is always one column for each list. If you need several columns, use Table.FromColumns or a different splitter.
- Check that the list items are text, not records, before you use it.
In business terms
Turning lists of codes, names or periods into tables for a join or a lookup is a routine step. Naming the splitter makes it clear that no text was cut by accident.