Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
Add new column if then in existing column
Best Answer
-
BalazsBarany Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert Posts: 955 UnicornHi!
You could use Generate Attributes for this.
Determining if a text starts with a number and ends with a letter is the domain of regular expressions. These are usable in different places in RapidMiner, there's even a nice regular expression editor for example in the Replace operator.
In Generate Attributes, you would use the if() and matches() functions. Here's an example for your use case:
if(matches(column_1, "^[0-9]+.+[a-zA-Z]$"), "Complete", "Incomplete")
The regexp is a bit terrifying in the beginning but it is simple to explain.
^ beginning of the string
[0-9] character class: Numbers from 0 to 9
+ at least one of the element before (the character class)
.+ anything
[a-zA-Z] letters (if you need additional characters, enter them after the Z)
$ end of the string
So the logic goes: If the value of column_1 matches the regular expression, the if function returns the second argument (Complete), else the third one.
Regards,
Balázs
0
Answers
Lindon Ventures
Data Science Consulting from Certified RapidMiner Experts