Dependency Cycles Error

Hi,

We are getting the below error and kindly seek further advise.

Build errors in this form:

  • Validation Error: Dependency cycles amongst the xpath expressions in
    relevant/calculate

More information:
Error: XPath Dependency Cycle:
/data/Alcoholism_women_Q2 => /data/alcoholism
/data/Alcoholism_women_Q2 => /data/non_alcoholism
/data/Alcoholism_women_Q1 => /data/Alcoholism_women_Q2
/data/non_alcoholism => /data/non_alcoholism_counter
/data/non_alcoholism_counter => /data/non_alcoholism_counter
/data/alcoholism => /data/alcoholism_counter
/data/alcoholism_counter => /data/alcoholism_counter
/data/Respondent_Gender => /data/Alcoholism_women_Q1
/data/Respondent_Gender => /data/Alcoholism_women_Q2
in form

Warm Regards,
Jeffrey

Hi Jeffrey,

This normally occurs when you have a calculation that is dependent on
itself. For example,
value_a => value_b +value_c
value_b => 23
value_c => value_a + 10

In this case, value_a can’t be calculated because it uses on value_c, which
in turn actually uses value_a.

Do you have anything like this happening in your form?

Thanks,
Sheel

··· On Mon, Aug 26, 2013 at 6:41 AM, Jeffrey Jose wrote:

Hi,

We are getting the below error and kindly seek further advise.

Build errors in this form:

  • Validation Error: Dependency cycles amongst the xpath expressions
    in relevant/calculate

More information:
Error: XPath Dependency Cycle:
/data/Alcoholism_women_Q2 => /data/alcoholism
/data/Alcoholism_women_Q2 => /data/non_alcoholism
/data/Alcoholism_women_Q1 => /data/Alcoholism_women_Q2
/data/non_alcoholism => /data/non_alcoholism_counter
/data/non_alcoholism_counter => /data/non_alcoholism_counter
/data/alcoholism => /data/alcoholism_counter
/data/alcoholism_counter => /data/alcoholism_counter
/data/Respondent_Gender => /data/Alcoholism_women_Q1
/data/Respondent_Gender => /data/Alcoholism_women_Q2
in form

Warm Regards,
Jeffrey


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Sheel Shah
Project Manager | Dimagi India
t: +91 1146704670 | m: +91 9560187282

It looks like your counter fields are referencing themselves. Guessing you
are incrementing them each time. To do this you actually need to load the
previous counter value into another hidden field using case management
(perhaps named prev_alchoholism_counter) and then reference that field in
your counter calculation. So calculation would be alcoholism_counter =
prev_alcoholism_counter + 1.

··· On Aug 26, 2013 7:47 AM, "Sheel Shah" wrote:

Hi Jeffrey,

This normally occurs when you have a calculation that is dependent on
itself. For example,
value_a => value_b +value_c
value_b => 23
value_c => value_a + 10

In this case, value_a can’t be calculated because it uses on value_c,
which in turn actually uses value_a.

Do you have anything like this happening in your form?

Thanks,
Sheel

On Mon, Aug 26, 2013 at 6:41 AM, Jeffrey Jose jeffreyjose@gmail.comwrote:

Hi,

We are getting the below error and kindly seek further advise.

Build errors in this form:

  • Validation Error: Dependency cycles amongst the xpath expressions
    in relevant/calculate

More information:
Error: XPath Dependency Cycle:
/data/Alcoholism_women_Q2 => /data/alcoholism
/data/Alcoholism_women_Q2 => /data/non_alcoholism
/data/Alcoholism_women_Q1 => /data/Alcoholism_women_Q2
/data/non_alcoholism => /data/non_alcoholism_counter
/data/non_alcoholism_counter => /data/non_alcoholism_counter
/data/alcoholism => /data/alcoholism_counter
/data/alcoholism_counter => /data/alcoholism_counter
/data/Respondent_Gender => /data/Alcoholism_women_Q1
/data/Respondent_Gender => /data/Alcoholism_women_Q2
in form

Warm Regards,
Jeffrey


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Sheel Shah
Project Manager | Dimagi India
t: +91 1146704670 | m: +91 9560187282


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Thank you. I got it. I was doing a=a+1. We now used a different variable
and that solved the problem.

Warm Regards,
Jeffrey

··· On Mon, Aug 26, 2013 at 12:13 PM, Nick Nestle wrote:

It looks like your counter fields are referencing themselves. Guessing you
are incrementing them each time. To do this you actually need to load the
previous counter value into another hidden field using case management
(perhaps named prev_alchoholism_counter) and then reference that field in
your counter calculation. So calculation would be alcoholism_counter =
prev_alcoholism_counter + 1.
On Aug 26, 2013 7:47 AM, “Sheel Shah” sshah@dimagi.com wrote:

Hi Jeffrey,

This normally occurs when you have a calculation that is dependent on
itself. For example,
value_a => value_b +value_c
value_b => 23
value_c => value_a + 10

In this case, value_a can’t be calculated because it uses on value_c,
which in turn actually uses value_a.

Do you have anything like this happening in your form?

Thanks,
Sheel

On Mon, Aug 26, 2013 at 6:41 AM, Jeffrey Jose jeffreyjose@gmail.comwrote:

Hi,

We are getting the below error and kindly seek further advise.

Build errors in this form:

  • Validation Error: Dependency cycles amongst the xpath expressions
    in relevant/calculate

More information:
Error: XPath Dependency Cycle:
/data/Alcoholism_women_Q2 => /data/alcoholism
/data/Alcoholism_women_Q2 => /data/non_alcoholism
/data/Alcoholism_women_Q1 => /data/Alcoholism_women_Q2
/data/non_alcoholism => /data/non_alcoholism_counter
/data/non_alcoholism_counter => /data/non_alcoholism_counter
/data/alcoholism => /data/alcoholism_counter
/data/alcoholism_counter => /data/alcoholism_counter
/data/Respondent_Gender => /data/Alcoholism_women_Q1
/data/Respondent_Gender => /data/Alcoholism_women_Q2
in form

Warm Regards,
Jeffrey


You received this message because you are subscribed to the Google
Groups “commcare-users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Sheel Shah
Project Manager | Dimagi India
t: +91 1146704670 | m: +91 9560187282


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.