Display Condition Error in the application

Hi everyone,
I am getting this error in the application, please help me fix this error.
Display Condition Error: Error in calculation for /data XPath nodeset has more than one node [/data/family_info[1]/individual_HIV_status[1];/data/family_info[2]/individual_HIV_status[1]]; cannot convert multiple nodes to a raw value. Refine path expression to match only one node.

Can you post the XPath expression you’re using for the display condition?

It looks like you’re using it inside a repeat group: /data/family_info. Most likely you want to use a relative xpath expression rather than an absolute one.

There is more detailed info on referencing data inside repeat group in the Advanced Functions for Repeat Groups section of the documentation.

Dear Simon,
I am posting xpath expression, please help me
Question id is “/data/total_family_income”
calculate condition
if(/data/family_info[1]/individual_income[1] != ‘’, /data/family_info[1]/individual_income[1], 0) + if(/data/family_info[2]/individual_income[2] != ‘’, /data/family_info[2]/individual_income[2], 0) + if(/data/family_info[3]/individual_income[3] != ‘’, /data/family_info[3]/individual_income[3], 0) + if(/data/family_info[4]/individual_income[4] != ‘’, /data/family_info[4]/individual_income[4], 0) + if(/data/family_info[5]/individual_income[5] != ‘’, /data/family_info[5]/individual_income[5], 0) + if(/data/family_info[6]/individual_income[6] != ‘’, /data/family_info[6]/individual_income[6], 0) + if(/data/family_info[7]/individual_income[7] != ‘’, /data/family_info[7]/individual_income[7], 0) + if(/data/family_info[8]/individual_income[8] != ‘’, /data/family_info[8]/individual_income[8], 0) + if(/data/family_info[9]/individual_income[9] != ‘’, /data/family_info[9]/individual_income[9], 0) + if(/data/family_info[10]/individual_income[10] != ‘’, /data/family_info[10]/individual_income[10], 0) + if(/data/family_info[11]/individual_income[11] != ‘’, /data/family_info[11]/individual_income[11], 0) + if(/data/family_info[12]/individual_income[12] != ‘’, /data/family_info[12]/individual_income[12], 0) + if(/data/family_info[13]/individual_income[13] != ‘’, /data/family_info[13]/individual_income[13], 0) + if(/data/family_info[14]/individual_income[14] != ‘’, /data/family_info[14]/individual_income[14], 0) + if(/data/family_info[15]/individual_income[15] != ‘’, /data/family_info[15]/individual_income[15], 0)

Normally you would only reference a question by index if it was in a repeat group. This XPath expression would suggest a form structure like this:

  • family_info (repeat)
    • individual_income (repeat)

But I think you must have this:

  • family_info (repeat with 15 iterations)
    • individual_income (numeric question)

In that case then your expression should look like this:

if(/data/family_info[1]/individual_income != ‘’, /data/family_info[1]/individual_income, 0) + ...

Note that I think you should be able to do the same thing using the sum function:

sum(/data/family_info/individual_income)

Dear Simon
thanks for contributing!