Skip to main content

Hi,

I am trying to run a cleaning step that identifies rows of data with a specified value in one column and renames the value in another column. This is different from the regular grouping/renaming step because it is dependent on the specific value from the other column.

In the attached sample flow, I want the step to find every instance of "Brand Name Tomatoes" in the 'Product Name' column and change the corresponding value in the 'Product Type' column from "Fruit" to "Vegetables" (controversial I know ;) ). I cannot group/rename the "Fruit" value to "Vegetables" because there are other products in the dataset that fall under the Fruit product type.

Cleaning step to change values in one column based on value in another columnApologies if the solution is too obvious, I am relatively new to working in Prep and could not find the same question on the forums. Thanks!

4 respostas
  1. 18 de jul. de 2024, 18:06

    Correct, you'd use nested ELSEIF statements thereafter. That should be all you'll need to do.

    IF [Product Name]='Brand Name Tomatoes' THEN 'Vegetables'

    ELSEIF [Product Name]='Brand Name Apples' THEN 'Vegetables'

    ELSE [Product Type] END

    As to modifying individual rows, no, you can only modify in the Profile Pane above the data grid, not the individual row itself hence the calculation. You can always remove or hide the [Product Name] field thereafter.

     

    Best, Don Wise -

    Please don’t forget to upvote and/or Select as Best by clicking the hyperlink below in the response that answered your question

0/9000