X path expression

Hi ,

I am getting a X-path error for this expression, If ( int(/data/month_calc)
< /data/month_calc , int(/data/month_calc) + 1, int(/data/month_calc))
saying "caanot handle IF function". This is a calculate condition in a
hidden value appmonth_calc.

month_calc is also a hidden value with calculate condition - number
((date(/data/visit_date)-date(/data/lmp_date))div 30.4).

Can anyone point out where is the mistake in this expression?

Thanks,
Ruchi

Ruchi,

I think this error is due to capitalization - 'if' needs to be all lower
case, otherwise CommCare will not recognize the function.

Best,
Will

··· On Wed, Feb 11, 2015 at 3:16 AM, Ruchi Deshpande < ruchi.deshpande@snehamumbai.org> wrote:

Hi ,

I am getting a X-path error for this expression, If (
int(/data/month_calc) < /data/month_calc , int(/data/month_calc) + 1,
int(/data/month_calc)) saying "caanot handle IF function". This is a
calculate condition in a hidden value appmonth_calc.

month_calc is also a hidden value with calculate condition - number
((date(/data/visit_date)-date(/data/lmp_date))div 30.4).

Can anyone point out where is the mistake in this expression?

Thanks,
Ruchi

--
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/d/optout.

Hi Ruchi,

In your "if" statement the condition you are checking is int(/data/month_calc)
< /data/month_calc
.
It seems like you are comparing the same value, one converted as an integer.
Is it correct?

Kind Regards

ID

··· On Wed, Feb 11, 2015 at 8:16 AM, Ruchi Deshpande < ruchi.deshpande@snehamumbai.org> wrote:

Hi ,

I am getting a X-path error for this expression, If (
int(/data/month_calc) < /data/month_calc , int(/data/month_calc) + 1,
int(/data/month_calc)) saying "caanot handle IF function". This is a
calculate condition in a hidden value appmonth_calc.

month_calc is also a hidden value with calculate condition - number
((date(/data/visit_date)-date(/data/lmp_date))div 30.4).

Can anyone point out where is the mistake in this expression?

Thanks,
Ruchi

--
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/d/optout.

--
Ismaila Diene

Technicien Terrain | Field Technician
Dimagi, Afrique de l'Ouest | Dimagi, West Africa

m: + <%28617%29%20596%206243>221 78 14 78 314
skype: isaack007
web: http://www.dimagi.com/