Hello,
As noted above, I've received an "Invalid type in operator" error for the following code:
IF findstring([DEPART/ARRIVE],substring([DEPART/ARRIVE],1,6))=substring([Row-1:DEPART/ARRIVE],1,6)
AND [DATE]=[Row-1:DATE]
AND [Stop?] = "1"
THEN [Stop?] = "0"
ELSE [Stop?] = "1"
ENDIF
Some quick searching says this tends to occur when there is a mismatch between string and numerical datatypes, hence the quotes around 1 and 0, but removing the quotes and using a Select tool to change them to INT16 does not appear to resolve the issue. I'm sure I'm missing something small, but any help would be appreciated.
Solved! Go to Solution.
HI @alexg1
It's the first line that's not quite correct. The error is with this part substring([DEPART/ARRIVE],1,6))=substring([Row-1:DEPART/ARRIVE],1,6)
Namely the equals that you have in there.
You have put a sub-query inside the find string.function.
Not quite sure what you are wanting to check there, are you wanting to see if its the same as the row before?
Hi Joe,
This is part of a multi-row formula. You are correct in that I want to compare it to the previous row and see if it is the same. The curveball here is that I only want to compare that specific substring. The rest of the string sometimes varies.
In which case, do you need the find string part?
Or can you just check those 6 characters are the same?
IF substring([DEPART/ARRIVE],1,6))=substring([Row-1:DEPART/ARRIVE],1,6)
AND [DATE]=[Row-1:DATE]
AND [Stop?] = "1"
THEN [Stop?] = "0"
ELSE [Stop?] = "1"
ENDIF
Looks like I was over-complicating things, this did it.
Thank you!
Great stuff, glad you got what you needed!