I am having a problem with the nested IF statement when trying to use more than 3 arguments. Below is my statement. I am trying to display a previously entered name of a market (string) based on the selection for var5.
if(${var5}='1',concat('Name of previous market is ',${M1NAME}),if(${M5PMM}='2', concat('Name of previous market is ',${M2NAME}),if(${var5}='3', concat('Name of previous market is ',${M3NAME}),concat('Name of previous market is ',${M4NAME}))))
I am getting this error message: The problem was located in calculate expression for ${gr18}.1/var5 XPath evaluation: cannot handle function 'IF' Caused by: org.javarosa.xpath.XPathUnhandledException: The problem was located in calculate expression for ${gr18}.1/var5 XPath evaluation: cannot handle function 'IF' ... 10 more Result: Invalid
I fixed that variable name and now I am getting another error message: ODK Validate Errors: >> Something broke the parser. See above for a hint. Dependency cycles amongst the xpath expressions in relevant/calculate Result: Invalid. This is the only change I have made in the form so there must be something wrong with the statement? Thank you.