Using indexed-repeat

Hi,

I have the following case, I have a loop that collects information about
family members like age, gender, and other related info. What I aim to do
is to have the number of babies under age 2 + plus the total number of
children under age 5.

My issue is that I don't have specific index to pass to the indexed-repeat
function to get any thing, I'm not sure if my case is supported by ODK.

Your help is greatly appreciated!

Thanks,-Hanan

Hi Hanan,

No need for indexed-repeat in your case. I would add two calculated items
inside your repeat:

  1. if (${age} < 2, 1, 0)
  2. if (${age} < 5, 1, 0)

You can then use sum() outside the repeat to get the two totals you want.

See https://odk.enke.to/preview?form=http://23.21.114.69/xlsform/tmp/tmp6kggxr/repeat-sum.xml
(temporary link)
and https://docs.google.com/spreadsheets/d/1P4iYypfNlXpp1ICp5CJTbwPTdgjdhE3aCbx6njz-XgQ/edit#gid=550584070.

Cheers,
Martijn

··· On Wednesday, August 12, 2015 at 7:48:36 AM UTC-6, Hanan Aqilan wrote: > > Hi, > > I have the following case, I have a loop that collects information about > family members like age, gender, and other related info. What I aim to do > is to have the number of babies under age 2 + plus the total number of > children under age 5. > > My issue is that I don't have specific index to pass to the indexed-repeat > function to get any thing, I'm not sure if my case is supported by ODK. > > Your help is greatly appreciated! > > Thanks,-Hanan >

Excitement!

Please share with me the excel sheet to have a look at how it is designed.

Bunch of thanks Marti!

··· On Wednesday, August 12, 2015 at 4:48:36 PM UTC+3, Hanan Aqilan wrote: > > Hi, > > I have the following case, I have a loop that collects information about > family members like age, gender, and other related info. What I aim to do > is to have the number of babies under age 2 + plus the total number of > children under age 5. > > My issue is that I don't have specific index to pass to the indexed-repeat > function to get any thing, I'm not sure if my case is supported by ODK. > > Your help is greatly appreciated! > > Thanks,-Hanan >

Hooray! Isn't awesome....

Will you judge me if I get some further into this :stuck_out_tongue:

What if I want for example to calculate the number of babies under age 2, I
want to do summation but by filtering the results by age. Can I do this?

Bear with me please as I'm novice to ODK...

··· On Wednesday, August 12, 2015 at 4:48:36 PM UTC+3, Hanan Aqilan wrote: > > Hi, > > I have the following case, I have a loop that collects information about > family members like age, gender, and other related info. What I aim to do > is to have the number of babies under age 2 + plus the total number of > children under age 5. > > My issue is that I don't have specific index to pass to the indexed-repeat > function to get any thing, I'm not sure if my case is supported by ODK. > > Your help is greatly appreciated! > > Thanks,-Hanan >

To clear it up. I want to filter but outside the loop not inside as stated
in your sample excel. Can I do this?

··· On Wednesday, August 12, 2015 at 4:48:36 PM UTC+3, Hanan Aqilan wrote: > > Hi, > > I have the following case, I have a loop that collects information about > family members like age, gender, and other related info. What I aim to do > is to have the number of babies under age 2 + plus the total number of > children under age 5. > > My issue is that I don't have specific index to pass to the indexed-repeat > function to get any thing, I'm not sure if my case is supported by ODK. > > Your help is greatly appreciated! > > Thanks,-Hanan >

Ya will try it out and post back the results here.

Thank ya.

··· On Wednesday, August 12, 2015 at 4:48:36 PM UTC+3, Hanan Aqilan wrote: > > Hi, > > I have the following case, I have a loop that collects information about > family members like age, gender, and other related info. What I aim to do > is to have the number of babies under age 2 + plus the total number of > children under age 5. > > My issue is that I don't have specific index to pass to the indexed-repeat > function to get any thing, I'm not sure if my case is supported by ODK. > > Your help is greatly appreciated! > > Thanks,-Hanan >

hi i have this indexed repeat i want to just repeat this all group of house hold member but the index repeat does not any help please

see attached

mutwangasurvey3.xls (77 KB)

··· On Wednesday, August 12, 2015 at 4:48:36 PM UTC+3, Hanan Aqilan wrote: > Hi, > > > I have the following case, I have a loop that collects information about family members like age, gender, and other related info. What I aim to do is to have the number of babies under age 2 + plus the total number of children under age 5. > > > My issue is that I don't have specific index to pass to the indexed-repeat function to get any thing, I'm not sure if my case is supported by ODK. > > > Your help is greatly appreciated! > > > Thanks,-Hanan

Hi Hanan,

The second link in my previous message was to the XLSForm.

Good luck,
Martijn

··· On Thursday, August 13, 2015 at 11:29:23 AM UTC-6, Hanan Aqilan wrote: > > > Excitement! > > Please share with me the excel sheet to have a look at how it is designed. > > Bunch of thanks Marti! > > On Wednesday, August 12, 2015 at 4:48:36 PM UTC+3, Hanan Aqilan wrote: >> >> Hi, >> >> I have the following case, I have a loop that collects information about >> family members like age, gender, and other related info. What I aim to do >> is to have the number of babies under age 2 + plus the total number of >> children under age 5. >> >> My issue is that I don't have specific index to pass to the >> indexed-repeat function to get any thing, I'm not sure if my case is >> supported by ODK. >> >> Your help is greatly appreciated! >> >> Thanks,-Hanan >> >

:slight_smile: The XForm format is really very powerful.

Yes, you can filter this afterwards as well. This is actually a simpler,
more elegant method, but the disadvantage is that you have to revert to
using XPath syntax. There is no XLSForm shortcut syntax for it.

Filter results like this: count(/data/member[age < 5])

See

(I haven't tested this in ODK Collect. Best to check this before investing
much time in using this method.)

Cheers,
Martijn

··· On Thu, Aug 13, 2015 at 2:21 PM, Hanan Aqilan wrote:

To clear it up. I want to filter but outside the loop not inside as stated
in your sample excel. Can I do this?

On Wednesday, August 12, 2015 at 4:48:36 PM UTC+3, Hanan Aqilan wrote:

Hi,

I have the following case, I have a loop that collects information about
family members like age, gender, and other related info. What I aim to do
is to have the number of babies under age 2 + plus the total number of
children under age 5.

My issue is that I don't have specific index to pass to the
indexed-repeat function to get any thing, I'm not sure if my case is
supported by ODK.

Your help is greatly appreciated!

Thanks,-Hanan

--

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/4SLiFys-UWg/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.

--

Revolutionizing data collection since 2012.

Enketo https://enketo.org/ | LinkedIn
http://www.linkedin.com/company/enketo-llc | GitHub
https://github.com/enketo | Twitter https://twitter.com/enketo
| Blog http://blog.enketo.org/

It is not clear (to me) what you want to do. Best to create a test form (as
short as possible
) with your attempt, if you want others to look at
finding a solution. Does it have anything to do with this discussion? If
not, create a new thread.

··· On Fri, Aug 14, 2015 at 9:24 AM, wrote:

On Wednesday, August 12, 2015 at 4:48:36 PM UTC+3, Hanan Aqilan wrote:

Hi,

I have the following case, I have a loop that collects information about
family members like age, gender, and other related info. What I aim to do
is to have the number of babies under age 2 + plus the total number of
children under age 5.

My issue is that I don't have specific index to pass to the
indexed-repeat function to get any thing, I'm not sure if my case is
supported by ODK.

Your help is greatly appreciated!

Thanks,-Hanan

hi i have this indexed repeat i want to just repeat this all group of
house hold member but the index repeat does not any help please

see attached

--

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/4SLiFys-UWg/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.

--

Revolutionizing data collection since 2012.

Enketo https://enketo.org/ | LinkedIn
http://www.linkedin.com/company/enketo-llc | GitHub
https://github.com/enketo | Twitter https://twitter.com/enketo
| Blog http://blog.enketo.org/