I need to do a substr and I have differents length in the specific column, so i need to apply the length function to firstly filter by length. I triyed this expression:
The error indicates a type conflict, but both columns are string:
Re your specific question, this error occurs when it cannot determine the type of your expression, or needs to perform a type conversion.
You can usually resolve this by wrapping the entire expression in the string() function
e.g
string( --your statement-- )
I was trying to work out your actual statement though as it looks a little odd. Without being able to see your data I cannot see what it is that you are trying to do as the construct you are using doesn’t make sense to me at the moment.
Hi @jpages , I found a couple of things that are weird from your screenshot.
You mentioned 2 columns, and you showed “coordinates” and “length” as columns, both string.
Are you using the “length” column? What does that column represent? Is it different from the results from the function length($coordinates$)? How is that column being used here? If it’s the same results, how is that column created (it should be an int if it’s the length of $coordinates$)?
I’m guessing you are using the String Manipulation? You can’t really do any if conditions in the String Manipulation. For that, you need Column Expressions node instead, that would be your best option. So that “syntax” that you are trying is not working as you expected.
Note: substr($coordinates$, 20, 12) (or substr(column("coordinates"), 20, 12)) will give you characters from the 21st position up to 32nd position, so you are not taking the last character, if that is what you want.