I want to limit the number of repeats based on the previous question. But, I want to add a condition :
The number of repeat is equal to the previous answer if the answer is <3 (0, 1 or 2).
And the number of repeat is equal to 3 if the answer is >=3 (3, 4, 5, etc.)
I tried using jr :count but it did not work.
Any help will be appreciated.
Thanks
Dynamic repeat counts should work. I'm not 100% sure, so your best bet
for help is to attach a small test form that shows exactly what you
are doing...
Yaw
···
--
Need ODK services? http://nafundi.com provides form design, server
setup, professional support, and software development for ODK.
I want to limit the number of repeats based on the previous question. But, I want to add a condition :
The number of repeat is equal to the previous answer if the answer is <3 (0, 1 or 2).
And the number of repeat is equal to 3 if the answer is >=3 (3, 4, 5, etc.)
I tried using jr :count but it did not work.
Any help will be appreciated.
Thanks
···
Le lundi 14 juillet 2014 16:23:33 UTC+2, elmaco...@gmail.com a écrit :
> I want to limit the number of repeats based on the previous question. But, I want to add a condition :
> - The number of repeat is equal to the previous answer if the answer is <3 (0, 1 or 2).
> - And the number of repeat is equal to 3 if the answer is >=3 (3, 4, 5, etc.)
> I tried using jr :count but it did not work.
> Any help will be appreciated.
> Thanks
>
> em
Another way would be to create 2 or 3 calculate questions to take the
number of counts you need to repeat.
···
On Tuesday, July 15, 2014 3:15:14 AM UTC+7, Yaw Anokwa wrote:
>
> Hi em,
>
> Dynamic repeat counts should work. I'm not 100% sure, so your best bet
> for help is to attach a small test form that shows exactly what you
> are doing...
>
> Yaw
> --
> Need ODK services? http://nafundi.com provides form design, server
> setup, professional support, and software development for ODK.
>
> On Mon, Jul 14, 2014 at 7:23 AM, <elmaco...@gmail.com > wrote:
> > I want to limit the number of repeats based on the previous question.
> But, I want to add a condition :
> > - The number of repeat is equal to the previous answer if the answer is
> <3 (0, 1 or 2).
> > - And the number of repeat is equal to 3 if the answer is >=3 (3, 4, 5,
> etc.)
> > I tried using jr :count but it did not work.
> > Any help will be appreciated.
> > Thanks
> >
> > em
> >
> > --
> > --
> > 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.
>
You wanted the following: I want to repeat the group of questions only
3 times but if the answer at q1 is either 1 or 2 the number of repeats
has to be equal to 1 or 2.
In the jr:count column on the repeat (where name is form) put the following...
number( if( ${q1}='1' or ${q1}='2', ${q1},'3' ) )
If q1 is 1 or 2, it returns q1. Otherwise, it returns 3. Then
everything is wrapped with number() because the if logic returns a
string.
Yaw
···
--
Need ODK services? http://nafundi.com provides form design, server
setup, professional support, and software development for ODK.