Repeat_count not working

Dear friends,

I'm working on a form which has two repeat groups. The first one records
the information about all household members and another one recording the
education of the household member. Problem is that I want to limit the
occurrence of the second group based on the number of household members
recorded in the first group. It seems that repeat_count should be used for
the job but it makes ODK collect crash. If I remove the corresponding
syntax, it works fine.

Here is more detailed structure of my form (I've omitted unnecessary
fields):

     repeat_count  begin repeat roster Household members    calculate 

mid text name Name select_one gender_list gender Gender integer
age Age calculate age6 calculate agem select_one yesno empl Are
you employed end repeat begin repeat education Education
count(${roster}) calculate rname calculate rpos calculate age6_c
calculate age6_d Was this question asked? Y/N select_one edu_list
edu6 What's the highest level of education ${rname} has achieved? end
repeat

Thanks in advance,

David

David,

What happens if you use an output to see what you get when call
count($roster). Do you get the number you expect?

What happens if you put a number in repeat_count. Does it work then?

Yaw

··· -- Need ODK services? http://nafundi.com provides form design, server setup, professional support, and software development for ODK.

On Wed, Jun 11, 2014 at 5:36 AM, David Sichinava david@sichinava.ge wrote:

Dear friends,

I'm working on a form which has two repeat groups. The first one records the information about all household members and another one recording the education of the household member. Problem is that I want to limit the occurrence of the second group based on the number of household members recorded in the first group. It seems that repeat_count should be used for the job but it makes ODK collect crash. If I remove the corresponding syntax, it works fine.

Here is more detailed structure of my form (I've omitted unnecessary fields):

  repeat_count

begin repeat roster Household members
calculate mid
text name Name
select_one gender_list gender Gender
integer age Age
calculate age6
calculate agem
select_one yesno empl Are you employed
end repeat

begin repeat education Education count(${roster})
calculate rname
calculate rpos
calculate age6_c
calculate age6_d Was this question asked? Y/N
select_one edu_list edu6 What's the highest level of education ${rname} has achieved?
end repeat

Thanks in advance,

David

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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

Yaw,

When I load blank form, it yields following error message: XPath
evaluation: type mismatch expected xpath path, got xpath expression:
"[count(/oecd[It's my form name]/responde[it's group name]/roster[it's
repeat name]), null]".

I've added calculate field and note which would compute and display the
count number of repeats, but I'm getting similar error with the following
tip: "you may need to use the indexed-repeat() function".

Thanks,

David

··· On Thu, Jun 12, 2014 at 7:21 PM, Yaw Anokwa wrote:

David,

What happens if you use an output to see what you get when call
count($roster). Do you get the number you expect?

What happens if you put a number in repeat_count. Does it work then?

Yaw

Need ODK services? http://nafundi.com provides form design, server
setup, professional support, and software development for ODK.

On Wed, Jun 11, 2014 at 5:36 AM, David Sichinava david@sichinava.ge wrote:

Dear friends,

I'm working on a form which has two repeat groups. The first one records
the information about all household members and another one recording the
education of the household member. Problem is that I want to limit the
occurrence of the second group based on the number of household members
recorded in the first group. It seems that repeat_count should be used for
the job but it makes ODK collect crash. If I remove the corresponding
syntax, it works fine.

Here is more detailed structure of my form (I've omitted unnecessary
fields):

  repeat_count

begin repeat roster Household members
calculate mid
text name Name
select_one gender_list gender Gender
integer age Age
calculate age6
calculate agem
select_one yesno empl Are you employed
end repeat

begin repeat education Education count(${roster})
calculate rname
calculate rpos
calculate age6_c
calculate age6_d Was this question asked? Y/N
select_one edu_list edu6 What's the highest level of education ${rname}
has achieved?
end repeat

Thanks in advance,

David

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the
Google Groups "ODK Community" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit/OZ_xUx5iZII/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
David Sichinava | GIS and Database Analyst | CRRC Georgia
+995 598 555 381 | http://www.datablog.ge

Hi David,

This might be one of those issues where referencing repeats in XLSForm
causes problems. Or it just might be that count cannot be updated
inside a loop.

Either way, I don't have a ton of cycles to figure it out, so I've
filed it at https://code.google.com/p/opendatakit/issues/detail?id=1020.

If you can provide a small test form you can attach to that issue,
it'll keep the core team track down the problem.

Yaw

··· -- Need ODK services? http://nafundi.com provides form design, server setup, professional support, and software development for ODK.

On Thu, Jun 12, 2014 at 9:44 AM, David Sichinava david@sichinava.ge wrote:

Yaw,

When I load blank form, it yields following error message: XPath evaluation: type mismatch expected xpath path, got xpath expression: "[count(/oecd[It's my form name]/responde[it's group name]/roster[it's repeat name]), null]".

I've added calculate field and note which would compute and display the count number of repeats, but I'm getting similar error with the following tip: "you may need to use the indexed-repeat() function".

Thanks,

David

On Thu, Jun 12, 2014 at 7:21 PM, Yaw Anokwa yanokwa@nafundi.com wrote:

David,

What happens if you use an output to see what you get when call
count($roster). Do you get the number you expect?

What happens if you put a number in repeat_count. Does it work then?

Yaw

Need ODK services? http://nafundi.com provides form design, server
setup, professional support, and software development for ODK.

On Wed, Jun 11, 2014 at 5:36 AM, David Sichinava david@sichinava.ge wrote:

Dear friends,

I'm working on a form which has two repeat groups. The first one records the information about all household members and another one recording the education of the household member. Problem is that I want to limit the occurrence of the second group based on the number of household members recorded in the first group. It seems that repeat_count should be used for the job but it makes ODK collect crash. If I remove the corresponding syntax, it works fine.

Here is more detailed structure of my form (I've omitted unnecessary fields):

  repeat_count

begin repeat roster Household members
calculate mid
text name Name
select_one gender_list gender Gender
integer age Age
calculate age6
calculate agem
select_one yesno empl Are you employed
end repeat

begin repeat education Education count(${roster})
calculate rname
calculate rpos
calculate age6_c
calculate age6_d Was this question asked? Y/N
select_one edu_list edu6 What's the highest level of education ${rname} has achieved?
end repeat

Thanks in advance,

David

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the Google Groups "ODK Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/opendatakit/OZ_xUx5iZII/unsubscribe.
To unsubscribe from this group and all its topics, send an email to opendatakit+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
David Sichinava | GIS and Database Analyst | CRRC Georgia
+995 598 555 381 | http://www.datablog.ge

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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

Hi Yaw,

Sorry for the delayed response.

Actually, it appears that there's a workaround - I put a calculate field
OUTSIDE of the first repeat group and then referred to this variable in the
second group's repeat-count property. Something like:

end repeat / household roster/

cntRoster / count(${roster})

begin repeat / repeat_count / ${cntRoster}

Hope it helps other people as well,

D.

··· On Wed, Jun 18, 2014 at 12:27 AM, Yaw Anokwa wrote:

Hi David,

This might be one of those issues where referencing repeats in XLSForm
causes problems. Or it just might be that count cannot be updated
inside a loop.

Either way, I don't have a ton of cycles to figure it out, so I've
filed it at https://code.google.com/p/opendatakit/issues/detail?id=1020.

If you can provide a small test form you can attach to that issue,
it'll keep the core team track down the problem.

Yaw

Need ODK services? http://nafundi.com provides form design, server
setup, professional support, and software development for ODK.

On Thu, Jun 12, 2014 at 9:44 AM, David Sichinava david@sichinava.ge wrote:

Yaw,

When I load blank form, it yields following error message: XPath
evaluation: type mismatch expected xpath path, got xpath expression:
"[count(/oecd[It's my form name]/responde[it's group name]/roster[it's
repeat name]), null]".

I've added calculate field and note which would compute and display the
count number of repeats, but I'm getting similar error with the following
tip: "you may need to use the indexed-repeat() function".

Thanks,

David

On Thu, Jun 12, 2014 at 7:21 PM, Yaw Anokwa yanokwa@nafundi.com wrote:

David,

What happens if you use an output to see what you get when call
count($roster). Do you get the number you expect?

What happens if you put a number in repeat_count. Does it work then?

Yaw

Need ODK services? http://nafundi.com provides form design, server
setup, professional support, and software development for ODK.

On Wed, Jun 11, 2014 at 5:36 AM, David Sichinava david@sichinava.ge wrote:

Dear friends,

I'm working on a form which has two repeat groups. The first one
records the information about all household members and another one
recording the education of the household member. Problem is that I want to
limit the occurrence of the second group based on the number of household
members recorded in the first group. It seems that repeat_count should be
used for the job but it makes ODK collect crash. If I remove the
corresponding syntax, it works fine.

Here is more detailed structure of my form (I've omitted unnecessary
fields):

  repeat_count

begin repeat roster Household members
calculate mid
text name Name
select_one gender_list gender Gender
integer age Age
calculate age6
calculate agem
select_one yesno empl Are you employed
end repeat

begin repeat education Education count(${roster})
calculate rname
calculate rpos
calculate age6_c
calculate age6_d Was this question asked? Y/N
select_one edu_list edu6 What's the highest level of education
${rname} has achieved?
end repeat

Thanks in advance,

David

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the
Google Groups "ODK Community" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit/OZ_xUx5iZII/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
opendatakit+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
David Sichinava | GIS and Database Analyst | CRRC Georgia
+995 598 555 381 | http://www.datablog.ge

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the
Google Groups "ODK Community" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit/OZ_xUx5iZII/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
David Sichinava | GIS and Database Analyst | CRRC Georgia
+995 598 555 381 | http://www.datablog.ge

Glad it's working!

Yaw

··· -- Need ODK services? http://nafundi.com provides form design, server setup, professional support, and software development for ODK.

On Fri, Jun 27, 2014 at 6:00 AM, David Sichinava david@sichinava.ge wrote:

Hi Yaw,

Sorry for the delayed response.

Actually, it appears that there's a workaround - I put a calculate field
OUTSIDE of the first repeat group and then referred to this variable in the
second group's repeat-count property. Something like:

end repeat / household roster/

cntRoster / count(${roster})

begin repeat / repeat_count / ${cntRoster}

Hope it helps other people as well,

D.

On Wed, Jun 18, 2014 at 12:27 AM, Yaw Anokwa yanokwa@nafundi.com wrote:

Hi David,

This might be one of those issues where referencing repeats in XLSForm
causes problems. Or it just might be that count cannot be updated
inside a loop.

Either way, I don't have a ton of cycles to figure it out, so I've
filed it at https://code.google.com/p/opendatakit/issues/detail?id=1020.

If you can provide a small test form you can attach to that issue,
it'll keep the core team track down the problem.

Yaw

Need ODK services? http://nafundi.com provides form design, server
setup, professional support, and software development for ODK.

On Thu, Jun 12, 2014 at 9:44 AM, David Sichinava david@sichinava.ge wrote:

Yaw,

When I load blank form, it yields following error message: XPath
evaluation: type mismatch expected xpath path, got xpath expression:
"[count(/oecd[It's my form name]/responde[it's group name]/roster[it's
repeat name]), null]".

I've added calculate field and note which would compute and display the
count number of repeats, but I'm getting similar error with the following
tip: "you may need to use the indexed-repeat() function".

Thanks,

David

On Thu, Jun 12, 2014 at 7:21 PM, Yaw Anokwa yanokwa@nafundi.com wrote:

David,

What happens if you use an output to see what you get when call
count($roster). Do you get the number you expect?

What happens if you put a number in repeat_count. Does it work then?

Yaw

Need ODK services? http://nafundi.com provides form design, server
setup, professional support, and software development for ODK.

On Wed, Jun 11, 2014 at 5:36 AM, David Sichinava david@sichinava.ge wrote:

Dear friends,

I'm working on a form which has two repeat groups. The first one
records the information about all household members and another one
recording the education of the household member. Problem is that I want to
limit the occurrence of the second group based on the number of household
members recorded in the first group. It seems that repeat_count should be
used for the job but it makes ODK collect crash. If I remove the
corresponding syntax, it works fine.

Here is more detailed structure of my form (I've omitted unnecessary
fields):

  repeat_count

begin repeat roster Household members
calculate mid
text name Name
select_one gender_list gender Gender
integer age Age
calculate age6
calculate agem
select_one yesno empl Are you employed
end repeat

begin repeat education Education count(${roster})
calculate rname
calculate rpos
calculate age6_c
calculate age6_d Was this question asked? Y/N
select_one edu_list edu6 What's the highest level of education
${rname} has achieved?
end repeat

Thanks in advance,

David

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the
Google Groups "ODK Community" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit/OZ_xUx5iZII/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
opendatakit+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
David Sichinava | GIS and Database Analyst | CRRC Georgia
+995 598 555 381 | http://www.datablog.ge

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the
Google Groups "ODK Community" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit/OZ_xUx5iZII/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
David Sichinava | GIS and Database Analyst | CRRC Georgia
+995 598 555 381 | http://www.datablog.ge

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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