Grab position of the maximum random number from repeat group

Dear ODK community,

I've got a repeat group of household members. For the selection purposes,
I'm generating a random number for each member and trying to get the name
of the household member which has highest random number in the nodeset.

Is it possible to get a position of the highest random number?

Best,

David

Hi David,

I think it's possible but probably not easy. You'll have to use some
combination of indexed-repeat() and max(). Other functions you can use
are at https://opendatakit.org/help/form-design/binding.

Build things incrementally and send out a very short example form to
the list if you get stuck.

Yaw

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

On Thu, Sep 17, 2015 at 2:09 AM, David Sichinava david@sichinava.ge wrote:

Dear ODK community,

I've got a repeat group of household members. For the selection purposes,
I'm generating a random number for each member and trying to get the name of
the household member which has highest random number in the nodeset.

Is it possible to get a position of the highest random number?

Best,

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.

And you will want to wrap your use of random() with once(). Otherwise,
each time you edit the form, new random values will be generated.

··· On Thu, Sep 17, 2015 at 10:51 AM, Yaw Anokwa wrote:

Hi David,

I think it's possible but probably not easy. You'll have to use some
combination of indexed-repeat() and max(). Other functions you can use
are at https://opendatakit.org/help/form-design/binding.

Build things incrementally and send out a very short example form to
the list if you get stuck.

Yaw

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

On Thu, Sep 17, 2015 at 2:09 AM, David Sichinava david@sichinava.ge wrote:

Dear ODK community,

I've got a repeat group of household members. For the selection purposes,
I'm generating a random number for each member and trying to get the
name of
the household member which has highest random number in the nodeset.

Is it possible to get a position of the highest random number?

Best,

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 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.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com