Calculations showing different figures dependent on language

Hi there, I’m looking at a form that is available in 4 languages and is populated using Enketo webforms (not the Collect app).

There are several repeating sections and groups with quite complex logic, and there are calculated totals shown throughout the form. It’s the form that Daria has looked at previously in another thread, troubleshooting repeat group logic Problems with data in generated repeat groups in Enketo

However, my question today is not about repeat groups per se, but about the strange fact that calculated fields display differently depending on which language the form is being filled out in. If the form is filled out in English the totals show correctly, but if the form is filled out in Spanish/French/Arabic then the totals sometimes show figures calculated from elsewhere in the form rather than the section they relate to. I’ve filled out the form in both English and Spanish at the same time with the same inputs and can clearly see the difference in behaviour. Have tried on multiple servers. It’s my understanding that the calculate logic should be completely independent of the language - and that would seem to be supported by the documentation e.g. https://support.kobotoolbox.org/calculate_questions.html

I have looked at the calculate logic and there’s nothing that references language - just always refers back to field names (which are independent of language label).

Any thoughts on what to look at next? Anyone seen this kind of behaviour before?

vs

  • English view of form correctly totalling 790+210 = 1000
  • Spanish view of form shows total of 22201 instead of 1000 - this total comes from a completely unrelated question earlier in the form. The wording (Spanish vs English) is just from the Label, so logic should be exactly the same in both cases.

Hi @nat,

Could you share your survey link (data collection, Enketo) so that we could too have a look at it.

In the mean time could you also share with us your xlsform with only the section that has an issue so that we could also see if we could reproduce this at our end.

Hi Nat,

The calculations are correct for all languages but the labels are wrong.

You can check any data already collected but you are mostly likely to find that the data in the export is correct and the error is only displayed on screen. If you change those labels it should resolve on screen as well.

Best regards,

Noel

2 Likes

Thanks @NoelCartONG that’s brilliant. I totally should’ve thought to check the labels instead of fixating on the logic. Many thanks for your troubleshooting support.

1 Like

No worries I initially did the same myself and was afraid it might be a browser issue or an enketo issue. If anything else is needed for this form just let us know.

2 Likes