Validate errors: dependency cycles amongst the xpath expressions

xlsform
form-design

(George) #1

Hi,
I have created an xls form that I want to convert for testing. However, I keep getting this error Error: b'ODK Validate Errors:\n>> Something broke the parser. See above for a hint.\nDependency cycles amongst the xpath expressions in relevant/calculate\n\nResult: Invalid'
I am using version 1.2.0.
Anyone who might know how I can resolve this problem kindly help. It is driving me crazy.

Thanks in advance.


ODK Validate error Dependency cycles amongst the xpath expressions in relevant/calculate
(Dr. Gareth S. Bestor) #2

Can you please post your form definition. It sounds like you may have a mutually incompatible/logically invalid pair of XPath calculations.


(George) #3

Hi Dr. Gareth.
Thank you for getting back to me.
I have managed to identify where the above mentioned problem. However, another problem cropped up.
When adding up the totals for hh incomes, hh expenditures and total incomes from other sources.

I will post the form definition so that you can have a look at it.

Thank you in advance.


(George) #4

Please see the form definition with the raws in question highlighted in red.
Kind regards.Mothers_questionnaire.xlsx (49.0 KB)


(Dr. Gareth S. Bestor) #5

Please share what you identified the problem to be, and how you fixed it, so that perhaps others landing here in the future can determine if they hit the same problem.

If there is now something else wrong in your form, please start a new thread. BTW, a common mistake when making summation calculations - eg your "adding up the totals" - is not handling potentially null/empty operands; see here


(Dr. Gareth S. Bestor) #6

Your ${totalhhpurchaseann} is a long summation of many other values. If any single one of these is not answered (ie null), then the entire sum will become invalid (NaN)! Unless every operand in your sum is mandatory, you have to explicitly add logic to your calculations to treat empty/null values as 0. Again, please refer to my previous link for details.


(Hélène Martin) #7

5 posts were split to a new topic: Dependency cycles amongst the xpath expressions


(George) #9

Hi, Xiphware,
The problem I found was I was adding a "relevant" function in the single select question select_one yn. That was what was breaking the logic path in the form.


(George) #10

I am working on amending the sum function as you have advised in your previous forum post. I will post here how it goes. Thank you for your help. Much appreciated.


(Riddhi Banerjee) #11

Hi! I keep getting this msg:

Error: b'ODK Validate Errors:\n>> Something broke the parser. See above for a hint.\nDependency cycles amongst the xpath expressions in relevant/calculate\n\nResult: Invalid'

Can someone explain why I am getting this result?Baseline_survey_Udaan.xlsx (51.8 KB)


(Dr. Gareth S. Bestor) #12

First off, you have typos in a lot of your relevant expressions. eg

selected(${children_anganwadi},'yes') or slected(${children_Udaan_centre},'yes')

Start by fixing all them, and have another go.