This workflow demonstrates how to do different If/Else constructions in Column Expressions node.
This is a companion discussion topic for the original entry at https://kni.me/w/srzVYM5I6NUM53eR
This workflow demonstrates how to do different If/Else constructions in Column Expressions node.
This tripped me up and I was pulling out my hair for a while…
Note the == is used for evaluation of nominal values. I should have remembered but it been a long time.
Thanks for providing the column expressions examples!
Very helpful, indeed.
It would be very helpful though, if there would be a low code solution for the everyday business user, that would allow powerful if else statements with a possibility to do data operations afterwards (Math formula, string manipulation etc.)
Hello @Residentstiefel,
glad to hear that. Yep, I do totally agree with you. Will forward it and let’s see.
Br,
Ivan
This is awesome. I am trying to normalize a date field where dates appear in one of these two formats. The dates are stored as Strings since they are different.
2021-04-08 or 04/21/2021
I would like to write a formula that will make the dates like the first format i.e yyyy-mm-dd. I am trying the below but something is wrong with my syntax. Any help would be much appreciated.
if (regexMatcher(column(“BEGIN_READ_DATE”),"/" ) = True)
{
substr(column(“BEGIN_READ_DATE”),7 ,4 ) & ‘-’ & substr(column(“BEGIN_READ_DATE”),1 ,2 ) & “-” & substr(column(“BEGIN_READ_DATE”),3 ,2 )
}
else{
column(“BEGIN_READ_DATE”)
}
Hi @Shmelky , you should expand on what do you mean by “something is wrong with my syntax”.
Are you getting any syntax errors? If so, what are they?
A few comments:
join(substr(column(“BEGIN_READ_DATE”),7 ,4 ), "-", substr(column(“BEGIN_READ_DATE”),1 ,2 ), "-”, substr(column(“BEGIN_READ_DATE”),3 ,2 ))
if (value > 0 && value < 10) {do something}
BTW, is there any reason for the inconsistency about single quotes and double quotes? You are using both single quotes and double quotes in your statement (& ‘-’ & and & “-” &)?
Thanks! Worked. Single versus double quotes was a mistake. No reason for it