I'm stuck on this tool. I'm trying to use the results in the current row to create a new field that indicates if the second row meets the criteria. I keep getting a malformed If statement and it's got to be something easy, I'm just stuck.
IF [Account]="Primary" and [Indicator]="Ok" and[Row+1:Units]>"0" then "SecondaryOK"
Else ""
ENDIF
I can add more if needed but hoping someone can look at this and see what I am messing up. thanks!
(sorry-i misscopied)
Solved! Go to Solution.
if statements require an else value so you have to add a base condition like Else [Units]
You put quotes on 0 meaning you are using it as string. String can not be compared try to remove the quotes for both side of 0.
IF [Account]="Primary" and [Indicator]="Ok" and[Row+1:Units]>
"0"then "SecondaryOK"
ENDIF
I tried without the quotes on the zero and still not working.
sorry-i had the else just didn't copy it in.
A few debugging suggestions:
First, check the meta-data on all your field types. You used quotes in your logic so everything should be a string, just confirm that (use the select tool or the Metadata toggle in the results window)
Second, by default if you are creating a new field with the multi-row - the field type defaults to INT32. Your then statement again is trying to create a string, adjust the config options to V_Wstring, that might be the solve
Lastly, if none of that works, check for things such as Spaces , Casing and Spelling - string logic is always susceptible to little nuances like that
One last thing - I just re-read you logic. > "0" isn't going to work, go back up stream (before this tool) and make sure units is a numeric field type, then go back to your logic and remove the "" around 0
Thanks everyone---I literally needed a space. Appreciate everyone helping and that's @Amilley the space did it. Happy Friday ya'll!
IF [Account]="Primary" and [Indicator]="Ok" and[Row+1:Units]>"0" then "SecondaryOK"
Else ""
ENDIF
IF [Account]="Primary" and [Indicator]="Ok" and [Row+1:Units]>"0" then "SecondaryOK"
Else ""
ENDIF