Need form design help to evaluate hygiene and COVID-19 compliances in different segment of a health facility

I am new to ODK and trying to develop a program by studying/practising. seeing an error as below. Requesting to resolve what does it mean

**5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.**DK Validate Errors: >> Something broke the parser. See below for a hint. Dependency cycles amongst the xpath expressions in relevant/calculate The following files failed validation: ${tmp8bqoi2ch} Result: Invalid

Your file should have the .xls or .xlsx file extension because Ona uses XLS Forms to create forms.

Not sure what to do? Read more aboutUsing XLSForms

Hi, if possible to share you can attach the form you are trying to upload. The most likely possibility is that in the relevant or calculate columns you refer to a question which does not come before that question. For example a question cannot have a relevancy or calculation that refers to itself or a question that comes afterwards.

The file with linkWASH_ps_v1.xlsx (45.1 KB)

This is the sheet for which i would like to prepare the odk.

Thanks noel for your support. I solved the problem with your suggestions. Now, i require your support to do calculations for total with different conditions. Can u help me.

Hi Noel, Can you help me to write down calculations for different combination. For example if in a hospital, seven sections are there and i need total score for only four section. what will be the calculation formulae.

Sure. I see that your form is related to Covid19 and CartONG is running a project where assistance is given for forms with a connection to this topic so just let me know exactly what you need for your calculation and it should be possible to find a way to do your calculation.

1 Like

Is the issue that the calculation must work even if a section of the form is not answered due to a relevancy? If so you may need to use if conditions in your calculations which replace null values with zeroes in a way that doesn't have adverse affects on weighted averages.

An example of an if condition to avoid this problem would be: if(${x}!='',${x},0)

Yes, Noel. we are trying to reduce the infection at government hospitals in India by complying water sanitation and Hygiene and COVID-19 compliances in different segment of a health facility. I am confused how to calculate the total score with different permutation.

OK no problem. Do you want to share the latest version of your form since you fixed the first error and we can look at how to calculate for the different permutations? My email is

If you can send me an example of some of the permutations for one section of your form I will create an example for you. If it includes any aspect that may be of general interest to the forum I will post the solution to the forum again once I have an understanding of the various permutations you need.

Thank You, Noel. I will mail you all the relevant files.

This looks like a very worthwhile project, @Hemant. More about @noel_cartong's support program at IM Covid Help Centre.

In general, we greatly appreciate it if support can stay on the forum so that others can benefit! Perhaps you could share the final improvements you end up with. Also note that since the forum does thread answers it's ok to have longer conversations. Thanks!

Thanks LN, It is a dream project of us and has been placed in WHO's best practices. But, in context to COVID-19, the crucial role is not properly comply in health facility. This project helps to reduce infection at hospitals by ensuring compliances. Noel has helped a lot and I have requested to finalize the error. I am waiting for his final file and would definitely share the Noel's knowledge on this platform. Would also like to acknowledge everybody's contribution as i am learning now. Thank You LN for inking me.

1 Like

Hi LN, as i did not get any reply form Noel, may i request you to help in resolving the issues. I need the calculation score and percentage at last for every section with Yes and No combination. Can u help me.

Hi @Hemant sorry, I havent had much time since yesterday.
@LN thanks for this advice. If its ok that it might run to a longer conversation happy to keep the conversation to public messages.

I share below the last version of the form from @Hemant.
The problem was calculating the percentage when there is a complex list of possible maximum scores due to different health facilities filling in different sections of the form.
The solution has been to have both calculated numerators and denominators so that the percentage is still possible to calculate in all cases and so that its not necessary to consider every possible combination of relevancies.

WASH_ps_v4.xlsx (46.5 KB)

@Hemant - Can you explain what you are missing in the attached doc and if I dont have time possibly someone else can help with the next step?

1 Like

Dear Noel, I need the total score at the last i.e. after SNCU in different combination for hospitals. For example if a hospital have only general section 1,2,3, (LR, OPD, PNCU) the final score and percentage.
2) If a hospital have general section 1,2,3, (LR, OPD, PNCU) and NRC, Paediatric ward, COVID Center, SNCU.
3) If a hospital have general section 1,2,3, (LR, OPD, PNCU) and NRC, Paediatric ward, COVID center and NO SNCU
4) If a hospital have general section 1,2,3, (LR, OPD, PNCU) and NRC, Paediatric ward, NO COVID center and NO SNCU
5) If a hospital have general section 1,2,3, (LR, OPD, PNCU) and NRC, NO Paediatric ward, NO COVID center and NO SNCU
I am unable to calculate the total score and percentage at the last so that it will show in the form of stars through ODK in android based phone.

would be grateful if you can do the programing in the given form.


Hi Hemant,

Please take a look at this version and let us know if its any closer. You will notice on line 398 I have added some extra numbers to the calculation, this is to account for the mandatory sections at the start of the form so best not to remove these numbers. In line 399 there is the round() function which you can use for all percentages to avoid too many decimals. At line 397 there are some if() functions. This is so that any sections which are not answered will be assigned a score of zero. This is I think why the note was not appearing for you previously, its important that sum calculations do not include references to empty fields, they must always be replaced by a zero.
WASH_ps_v4.xlsx (45.8 KB)

THANKS A LOT Noel, for putting your intelligence into the form and make it successful. I have uploaded it in the ona platform and form is working fine. A bit problem is the overall percentage is coming to more than 100 at last and in some section. I am trying to get these errors, however i am extending my heartfelt thanks to you for helping me inspite of your busy schedule. Lots of things i learnt.
@LN, Noel is of much helping nature as you are. ITs great to learn from both of you and would like to work with you in my individual capacity. THANKS a lot. Noel has uploaded the form in the platform so that other can also use and learn.
THANKS Noel. pls be in touch.

Regards, Hemant

Hi Hemant,

It sounds like you have some manual coding errors in different sections of the form which when added together cause an incorrect calculation in the total. If you don't find them all, let me know and I will test the calculations either tomorrow or Monday.


Hi Hermatt,

Please see the attached form. The below changes have been made:

  • Calculations fixed so that they all total to 100% - worth doing some testing on this on your side as well to make sure its as you need but the main errors look to be removed.
  • Calculations checked against your scoring table. No change made after this check as although the labor room section differs in many questions, its looks to be intentional.
  • Calculations are all now done in a standard way (no more multiplying by decimal numbers in calculations or unrounded percentages)
  • Required setting added where missing (4 questions asking if NRC, CCC, Paed and PNCU exist in the hospital)
  • Use of groups updated to prevent notes appearing for optional groups which the user didn't select. Makes the form less confusing for the user.

WASH_ps_v5.xlsx (47.9 KB)

Hope this helps you a step further to a completed form, if you have any other questions just let us know and I will take a look on Monday.

1 Like