Hi @mariesylvia , both @ScottF and I could have written the correct Knime code for you in our initial posts, but the idea was to guide you enough for you to figure it out. That way you would know how to translate other future code 
I’m glad to see that you are trying to get the correct translated code, it’s almost there 
I’m glad you figured out how to reference to a column, but using the column() function, and you also figured out the join() function.
So, a few corrections to apply to your code:
i) if conditions should be put in brackets. For example:
if length(column(“Loc Num”) <= 7)
should be written as:
if (length(column(“Loc Num”) <= 7))
ii) An if statement can only have 1 else. It can, however, have multiple else if. The else is basically the default operation when none of the if and else if are not satisfied. It should be last. This is the same for all programming languages, and same as what you have in your Alteryx code.
The basic template would be:
if (condition 1) {
operation for condition 1
} else if (condition 2) {
operation for condition 2
} else if (condition n) {
operation for condition n
} else {
default operation
}
Note: Parentheses are not necessary when you have just 1 operation, but it is good practice to use them. I’ve seen coders do this:
<some code>
if (condition)
// operation
<some other code>
They would comment out the operation part as a way to skip the if statement. However, they would not get the expected results, and would go nuts trying to figure out why. The issue here is by commenting out the operation, the <some other code>
part now becomes the new operation, and now instead of always executing the <some other code>
, it’s executed only if the if condition is true. With parentheses, you avoid this issue
<some code>
if (condition) {
// operation
}
<some other code>
<some other code>
remains outside of the if and will execute no matter the if condition.
Note 2: Single line if statements are also accepted, like you wrote in your code.
iii) Lastly, there are a few operations that you are performing that are invalid in the Column Expression, at least it’s not the proper command. For example, you cannot use LIKE or MISSING or Empty (these are valid in other nodes). The correct replacements are actually functions that are close to what you use in your code for Alteryx.
To see what the proper function names to use, you can view the list of the functions from the function dropdown as I mentioned before. This is what I am referring to:

When you click on this, you get a dropdown with all the functions that are supported. You even get a brief description of the function and how to use it:
You also don’t need to type the function in your code. You can just double click on it from the dropdown and it will appear in your code.
Similarly for accessing columns and variables, you can click on these:

So, for your function contains()
, you can use contains()
in the Column Expression. It’s the same function.
In terms of missing and empty, if I’m not mistaken, they mean the same in Knime, and can be checked using the isMissing()
function
And your Length()
function is the length()
function in Knime.
FYI, these 2 elseif from your original code:
elseif IsNull([Loc Num]) then “”
elseif IsEmpty([Loc Num]) then “”
can be merged as 1 elseif like this in Alteryx:
elseif IsNull([Loc Num]) OR IsEmpty([Loc Num]) then “”
So, can you correct your if statements based on these instructions? 