XPath evaluation: cannot handle function 'if'

Hello Friend,
I am Obsa from Ethiopia. I get puzzled with the following error with my recent data collection form developed in XLS form and please help!
Here is an attachment for your kind in put thank you very much.
Draft-Kobo script.xlsx (39.7 KB)
Error: ODK Validate Errors:

Something broke the parser. See above for a hint.
Error evaluating field 'split_direct' (${group_calculation_2024}[1]/split_direct[1]): The problem was located in Calculate expression for ${split_direct}
XPath evaluation: cannot handle function 'if'. Requires 3 arguments but 4 provided.
Caused by: org.javarosa.xpath.XPathUnhandledException: The problem was located in Calculate expression for ${split_direct}
XPath evaluation: cannot handle function 'if'. Requires 3 arguments but 4 provided.
... 10 more

The following files failed validation:
${Draft-Kobo} script.xml

Result: Invalid

The if() function requires 3 arguments

if(expression, then, else)
if(    1,        2,    3 )

and your calculation for your question with name = split_direct has too many arguments for the final if() operator:

2 Likes