Counting the number of iterations in a repeat

Hello - I'm currently working on a survey that involved revisiting and using data from multiple iterations within a previous repeat - I have figured out how to do this with a repeat that has a specific number of iterations, but I am trying to get the same functionality with an indefinite loop. Is there any way to access the number of a specific iteration within a loop? (as in 1 for the 1st repeat, 2 for the second, etc)

Hi there,

position(..) inside a loop should get you the count.

Yaw

··· -- Need ODK consultants? Nafundi provides form design, server setup, in-field training, and software development for ODK. Go to https://nafundi.com to get started.

On Sun, Sep 18, 2016 at 3:14 AM, questionmark1031@gmail.com wrote:

Hello - I'm currently working on a survey that involved revisiting and using data from multiple iterations within a previous repeat - I have figured out how to do this with a repeat that has a specific number of iterations, but I am trying to get the same functionality with an indefinite loop. Is there any way to access the number of a specific iteration within a loop? (as in 1 for the 1st repeat, 2 for the second, etc)

--

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.

Have a row with type *calculate *and put position(..) in the *calculation
*column

··· On Monday, 19 September 2016 19:56:40 UTC+2, question...@gmail.com wrote: > > Hello - I'm currently working on a survey that involved revisiting and > using data from multiple iterations within a previous repeat - I have > figured out how to do this with a repeat that has a specific number of > iterations, but I am trying to get the same functionality with an > indefinite loop. Is there any way to access the number of a specific > iteration within a loop? (as in 1 for the 1st repeat, 2 for the second, etc)

First, Thanks for the reply Yaw, i found the file extremely helpful.
I really appreciate it. :slight_smile:

Second, I must apologize myself to take so long to answer, i was away from
keyboard for a while but i'm back.

Thanks again.

Best regards from Mexico

··· On Monday, September 19, 2016 at 12:56:40 PM UTC-5, question...@gmail.com wrote: > > Hello - I'm currently working on a survey that involved revisiting and > using data from multiple iterations within a previous repeat - I have > figured out how to do this with a repeat that has a specific number of > iterations, but I am trying to get the same functionality with an > indefinite loop. Is there any way to access the number of a specific > iteration within a loop? (as in 1 for the 1st repeat, 2 for the second, etc)

Hi there,

position(..) inside a loop should get you the count.

Yaw

Need ODK consultants? Nafundi provides form design, server setup,
in-field training, and software development for ODK. Go to
https://nafundi.com to get started.

Hello - I'm currently working on a survey that involved revisiting and using data from multiple iterations within a previous repeat - I have figured out how to do this with a repeat that has a specific number of iterations, but I am trying to get the same functionality with an indefinite loop. Is there any way to access the number of a specific iteration within a loop? (as in 1 for the 1st repeat, 2 for the second, etc)

--

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.

Thanks. Is there a way to implement this within xlsforms or would I need to directly edit the xml file?

··· On Tuesday, September 20, 2016 at 3:31:47 AM UTC-7, Yaw Anokwa wrote: > On Sun, Sep 18, 2016 at 3:14 AM, wrote:

Hey there, any xls example of this?
Much appreciated in advance :slight_smile:

Best regards from Mexico.

N

··· On Monday, September 26, 2016 at 8:27:40 AM UTC-5, Sam Phiri wrote: > > Have a row with type *calculate *and put *position(..)* in the *calculation > *column > > On Monday, 19 September 2016 19:56:40 UTC+2, question...@gmail.com wrote: >> >> Hello - I'm currently working on a survey that involved revisiting and >> using data from multiple iterations within a previous repeat - I have >> figured out how to do this with a repeat that has a specific number of >> iterations, but I am trying to get the same functionality with an >> indefinite loop. Is there any way to access the number of a specific >> iteration within a loop? (as in 1 for the 1st repeat, 2 for the second, etc) > >

Hi Neri,

Try this.

Yaw

repeat_count.xlsx (34.9 KB)

··· On Tue, Nov 15, 2016 at 4:31 PM, Neri David Martinez wrote: > Hey there, any xls example of this? > Much appreciated in advance :) > > Best regards from Mexico. > > N > > > On Monday, September 26, 2016 at 8:27:40 AM UTC-5, Sam Phiri wrote: >> >> Have a row with type calculate and put position(..) in the calculation >> column >> >> On Monday, 19 September 2016 19:56:40 UTC+2, question...@gmail.com wrote: >>> >>> Hello - I'm currently working on a survey that involved revisiting and >>> using data from multiple iterations within a previous repeat - I have >>> figured out how to do this with a repeat that has a specific number of >>> iterations, but I am trying to get the same functionality with an indefinite >>> loop. Is there any way to access the number of a specific iteration within a >>> loop? (as in 1 for the 1st repeat, 2 for the second, etc) > > -- > -- > 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.
2 Likes

A post was merged into an existing topic: Problem with index repeat