Referencing using Index-repeat

Hi Team,

I am using index-repeat to refer to previously entered data to create a
choice list and thereafter use that choice list as a select one for
subsequent questions.

Example:

begin repeat: Q1. What crop did you plant in winter? ...

  • Q2. What crop did you plant in summer? ... Q3. What crop
    did you plant in rainy? ...end repeat*

Now this is what I have done:
line1 calculate ......index-repeat (${select_winter},${repeat_name},1)
line2 calculate ...... index-repeat (${select_summer},${repeat_name},2)
line2 calculate ...... index-repeat (${select_rainy},${repeat_name},3)

see attached:

Now instead of returning the three fields, it returns only one field. and
that's the 1st field. Please how can I make it to return the three fields
in every loop?

Also, I used "jr:" Java Rosa to return label instead of name for the
created choice list. How can i save respective choice code instead of
label: Example if maize code was 2 then thats what gets saved instead of
label maize getting saved like the case now:

Regards.

Collins

Sorry didnt attach the file;

example.xls (48 KB)

Hey Collins,
Did you ever get the solution to this. Would be glad if you share...
Whihza

··· On Friday, 28 February 2014 16:07:15 UTC+1, Collins McAdoyo wrote: > > Hi Team, > > I am using index-repeat to refer to previously entered data to create a > choice list and thereafter use that choice list as a select one for > subsequent questions. > > Example: > > > > *begin repeat: Q1. What crop did you plant in winter? ...* > > > > > * Q2. What crop did you plant in summer? ... Q3. What crop > did you plant in rainy? ...end repeat* > > Now this is what I have done: > line1 calculate ......index-repeat > (${select_winter},${repeat_name},1) > line2 calculate ...... index-repeat > (${select_summer},${repeat_name},2) > line2 calculate ...... index-repeat (${select_rainy},${repeat_name},3) > > see attached: > > Now instead of returning the three fields, it returns only one field. and > that's the 1st field. Please how can I make it to return the three fields > in every loop? > > > Also, I used "jr:" Java Rosa to return label instead of name for the > created choice list. How can i save respective choice code instead of > label: Example if maize code was 2 then thats what gets saved instead of > label maize getting saved like the case now: > > Regards. > > Collins > >

Dear Whihza,

Yes, I got the way about it. Please what exactly would you like to know? Perhaps you can share with the xls for this section to enable me guide you.

Kind regards.
Collins

··· -----Original Message----- From: "Whihza" Sent: ‎8/‎19/‎2015 3:59 PM To: "ODK Community" Subject: [ODK Community] Re: Referencing using Index-repeat

Hey Collins,
Did you ever get the solution to this. Would be glad if you share...
Whihza

On Friday, 28 February 2014 16:07:15 UTC+1, Collins McAdoyo wrote:
Hi Team,

I am using index-repeat to refer to previously entered data to create a choice list and thereafter use that choice list as a select one for subsequent questions.

Example:

begin repeat:
Q1. What crop did you plant in winter?
...
Q2. What crop did you plant in summer?
...
Q3. What crop did you plant in rainy?
...
end repeat

Now this is what I have done:
line1 calculate ......index-repeat (${select_winter},${repeat_name},1)
line2 calculate ...... index-repeat (${select_summer},${repeat_name},2)
line2 calculate ...... index-repeat (${select_rainy},${repeat_name},3)

see attached:

Now instead of returning the three fields, it returns only one field. and that's the 1st field. Please how can I make it to return the three fields in every loop?

Also, I used "jr:" Java Rosa to return label instead of name for the created choice list. How can i save respective choice code instead of label: Example if maize code was 2 then thats what gets saved instead of label maize getting saved like the case now:

Regards.

Collins

--

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.

Dear Collins,

How do you reference a label in indexed-repeat(${},${},1).. so that you
refer to the label and not the name of the variable?

Stanley.

··· On Thursday, August 20, 2015 at 5:48:17 PM UTC+3, Collins McAdoyo wrote: > > Dear Whihza, > > Yes, I got the way about it. Please what exactly would you like to know? > Perhaps you can share with the xls for this section to enable me guide you. > > Kind regards. > Collins > > ------------------------------ > From: Whihza > Sent: ‎8/‎19/‎2015 3:59 PM > To: ODK Community > Subject: [ODK Community] Re: Referencing using Index-repeat > > Hey Collins, > Did you ever get the solution to this. Would be glad if you share... > Whihza > > > On Friday, 28 February 2014 16:07:15 UTC+1, Collins McAdoyo wrote: >> >> Hi Team, >> >> I am using index-repeat to refer to previously entered data to create a >> choice list and thereafter use that choice list as a select one for >> subsequent questions. >> >> Example: >> >> >> >> *begin repeat: Q1. What crop did you plant in winter? ...* >> >> >> >> >> * Q2. What crop did you plant in summer? ... Q3. What crop >> did you plant in rainy? ...end repeat* >> >> Now this is what I have done: >> line1 calculate ......index-repeat >> (${select_winter},${repeat_name},1) >> line2 calculate ...... index-repeat >> (${select_summer},${repeat_name},2) >> line2 calculate ...... index-repeat >> (${select_rainy},${repeat_name},3) >> >> see attached: >> >> Now instead of returning the three fields, it returns only one field. and >> that's the 1st field. Please how can I make it to return the three fields >> in every loop? >> >> >> Also, I used "jr:" Java Rosa to return label instead of name for the >> created choice list. How can i save respective choice code instead of >> label: Example if maize code was 2 then thats what gets saved instead of >> label maize getting saved like the case now: >> >> Regards. >> >> Collins >> >> > -- > -- > Post: opend...@googlegroups.com > Unsubscribe: opendatakit...@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...@googlegroups.com . > For more options, visit https://groups.google.com/d/optout. >