Chaining computed columns

What is the correct way to compute the equivalent of Capitalize(Split(ColumnA, 'My sentence always starts with') ?
It seems like each column can only apply one transform/computation, but a computed column cannot take as input another computed column?

Can you explain this function a little more? What would the value in ColumnA look like and what would you expect for a result?

Sure, let:

  • Column A be a column containing text of the following format - and the values are all lower case.
    For example: “fresh fruit - pink lady apples”

I’d like to split the data in Column A into two columns: product category and product name such that I get the following output:

  • Product Category: “Fresh fruit”
  • Product Name: “Pink lady apples”

In this example, the split delimiter will be (’ - ').
In my original example, I am actually splitting text values returned from GPT hence the strange delimiter, but the above example has the same pattern.

Here’s my setup with JavaScript.

image

return p1.split(" - ")[0].replace(/^./, (match) => match.toUpperCase())

And for the name, it’s the same, just change the index from the split array.

return p1.split(" - ")[1].replace(/^./, (match) => match.toUpperCase())
3 Likes