Do you know the History of Data Science? READ MORE

data preparation

Solved!
mgirdwood
Level 2
data preparation

Hi - Is it possible to add a new column then to populate the rows using the  based on criteria that looks at one of the other columns, such as in excel 

=IF(B1=1, "Start", "Stop")       Where B1 is the column name

Thanks

0 Kudos
1 Solution
tgb417
Neuron
Neuron

You can also nest if statements.

 

--Tom

View solution in original post

0 Kudos
4 Replies
tgb417
Neuron
Neuron

@mgirdwood ,

In a word Yes, you can do this.

If you are using a visual recipe,  You can "Add a New" formula step.  You can then "Open Editor Pannel" and can add a formula.

Formula Editor.png

Note that although this formula language looks a lot like MS Excel Formulas.  It is not the same.  Here are a few things that threw me off when getting started:

  • The formula language is case-sensitive IF and If and iF will not work.  Only the all lower case version if will work.
  • It is often helpful to put number columns in the function numval() this will tend to deal with column names that have spaces in the names and other challenges.

Here is a link to the documentation of the formula language.

Hope this helps.  Please let us know how you are getting on with your challanges.

--Tom
0 Kudos
mgirdwood
Level 2
Author

Thanks Tom, as an additional query, what about multiple outputs such as in the excel =IFS(), I can not seem to see a similar option in the formula language details

 

Mark 

0 Kudos
tgb417
Neuron
Neuron

If you mean that you want to do something like this.

if(numval('is_rework') == 1 || numval('Titan') == 1, 'Start', 'Stop')

Check out the Operators in the formula language.

  • Boolean operators: &&, ||

--Tom
0 Kudos
tgb417
Neuron
Neuron

You can also nest if statements.

 

--Tom

View solution in original post

0 Kudos