Hi, I am getting a Malformed IF statement on Multi-Row Formula tool and I can't work out why have tried lots of variations but keep getting errors.
I want to see the same populated in both rows that relate to each other. I am grouping by a specific field (Trade ID) and this record has 2 lines and I want to check that both sides agree and populate whether it is an error (Break) or not.
The statement I am using is:
IF [SIDE] = "GTR" AND [Row+1:UTI_ID] = [UTI_ID] then "OK" ELSE "BREAK" ELSEIF [SIDE] = "ARRT" AND [Row-1:UTI_ID] = [UTI_ID] then "OK" ELSE "BREAK" ENDIF
It works for one side if I remove everything after the ELSEIF.
Thanks
Solved! Go to Solution.
Hi!
You can't have an else and and elseif in the same non-closed if statement...
IF [SIDE] = "GTR" AND [Row+1:UTI_ID] = [UTI_ID] then "OK" ELSE "BREAK" ELSEIF [SIDE] = "ARRT"
You can only have a single 'else' criteria per if statement. i.e. if the count of 'else' exceeds the count of 'if' then your statement has not been formatted correctly.
I believe you want your statement to be...
IF [SIDE] = "GTR" AND [Row+1:UTI_ID] = [UTI_ID] then "OK"
ELSEIF [SIDE] = "ARRT" AND [Row-1:UTI_ID] = [UTI_ID] then "OK"
ELSE "BREAK" ENDIF
Ben
You cannot have an ELSE before an ELSEIF. The proper syntax would be:
IF [SIDE] = "GTR" AND [Row+1:UTI_ID] = [UTI_ID] then "OK" ELSEIF [SIDE] = "ARRT" AND [Row-1:UTI_ID] = [UTI_ID] then "OK" ELSE "BREAK" ENDIF
EDIT: @BenMoss 's reply is the same, and better. Refresh rate is a killer.
Hi,
Can you post sample data and the expected results? The statement is malformed because of the mix of ELSE and ELSEIF and I'm not quite clear on what the tests should be.
Iain
Edit: Ignore - see previous answers
Thank you! this worked :)