Arrays

I have not seen this in the documentation or in the XLSForm, so am posting
it here--sorry if I just missed it somewhere.

I need to have the content of one field set the row of a primary array,
then a second field sets the column using an small auxillary array, and the
result is returned from the primary array into a third field. In Excel, I
do this with a double use of vlookup, so it looks something vaguely like
this:

=vlookup(cell1, array1, vlookup(cell2, array2,2))

Can something similar be done in ODK?

TIA

Jerry

Don't think you can. If you give us a description of the specific end
goal, we might have some ideas.

··· On Thu, May 3, 2012 at 3:39 PM, Jerry3904 wrote: > I have not seen this in the documentation or in the XLSForm, so am posting > it here--sorry if I just missed it somewhere. > > I need to have the content of one field set the row of a primary array, then > a second field sets the column using an small auxillary array, and the > result is returned from the primary array into a third field. In Excel, I > do this with a double use of vlookup, so it looks something vaguely like > this: > > =vlookup(cell1, array1, vlookup(cell2, array2,2)) > > Can something similar be done in ODK? > > TIA > > Jerry > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en

Thanks for the response, Yaw.

Normally, I do this in the "backend" (a spreadsheet), and collect just
the parameters in the field, and maybe that is what I will end up
doing here. But for practical reasons it would be very helpful to
have the returned value on the screen.

In my case, I am using an array that returns a Tree Risk rating from
the intersection of the parameters "Likelihood" and "Consequences." I
have put in a field for each of those parameters with 4 values for
each defined on the choices worksheet (e.g., good, bad, ugly, null).
The first parameter then should be used to set the row to look at in
the reference array, and the second the column, with the content of
the cell at the intersection being returned.

Thus, for example, if ${Likelihood}="unlikely" and ${Consequences}
="minor" then ${Risk}="Low." It seems to me that this would be a very
useful general function for ODK Collect if it could be worked out. I
am going to fiddle around with some relevant statements--can they be
nested--to see if anything starts to work.

Hope this makes things clearer, though maybe not...

··· On May 3, 7:16 pm, Yaw Anokwa wrote: > Don't think you can. If you give us a description of the specific end > goal, we might have some ideas. > > > > > > > > On Thu, May 3, 2012 at 3:39 PM, Jerry3904 wrote: > > I have not seen this in the documentation or in the XLSForm, so am posting > > it here--sorry if I just missed it somewhere. > > > I need to have the content of one field set the row of a primary array, then > > a second field sets the column using an small auxillary array, and the > > result is returned from the primary array into a third field. In Excel, I > > do this with a double use of vlookup, so it looks something vaguely like > > this: > > > =vlookup(cell1, array1, vlookup(cell2, array2,2)) > > > Can something similar be done in ODK? > > > TIA > > > Jerry > > > -- > > Post: opendatakit@googlegroups.com > > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > > Options:http://groups.google.com/group/opendatakit?hl=en

You can use relevancy to do this sort of thing. That is make an output
prompt relevant if certain conditions are met. The catch here is that
you have to make an exhaustive list of all the possibilities.

··· On Thu, May 3, 2012 at 6:05 PM, Jerry3904 wrote: > Thanks for the response, Yaw. > > Normally, I do this in the "backend" (a spreadsheet), and collect just > the parameters in the field, and maybe that is what I will end up > doing here. But for practical reasons it would be very helpful to > have the returned value on the screen. > > In my case, I am using an array that returns a Tree Risk rating from > the intersection of the parameters "Likelihood" and "Consequences." I > have put in a field for each of those parameters with 4 values for > each defined on the choices worksheet (e.g., good, bad, ugly, null). > The first parameter then should be used to set the row to look at in > the reference array, and the second the column, with the content of > the cell at the intersection being returned. > > Thus, for example, if ${Likelihood}="unlikely" and ${Consequences} > ="minor" then ${Risk}="Low." It seems to me that this would be a very > useful general function for ODK Collect if it could be worked out. I > am going to fiddle around with some relevant statements--can they be > nested--to see if anything starts to work. > > Hope this makes things clearer, though maybe not... > > On May 3, 7:16 pm, Yaw Anokwa wrote: >> Don't think you can. If you give us a description of the specific end >> goal, we might have some ideas. >> >> >> >> >> >> >> >> On Thu, May 3, 2012 at 3:39 PM, Jerry3904 wrote: >> > I have not seen this in the documentation or in the XLSForm, so am posting >> > it here--sorry if I just missed it somewhere. >> >> > I need to have the content of one field set the row of a primary array, then >> > a second field sets the column using an small auxillary array, and the >> > result is returned from the primary array into a third field. In Excel, I >> > do this with a double use of vlookup, so it looks something vaguely like >> > this: >> >> > =vlookup(cell1, array1, vlookup(cell2, array2,2)) >> >> > Can something similar be done in ODK? >> >> > TIA >> >> > Jerry >> >> > -- >> > Post: opendatakit@googlegroups.com >> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> > Options:http://groups.google.com/group/opendatakit?hl=en > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en

Here's a solution that leverages Clayton's itext inverse-label display
technique described on this thread (
http://groups.google.com/group/opendatakit/browse_thread/thread/c44f26680ac866ce/c64809383e3a3146).

Basically, put the answers into the itext mapping, then construct the name
of the itext entry from your data values, and retrieve the answer via the
jr:itext() call.

http://www.cs.washington.edu/homes/msundt/lookup/

Mitch

··· On Thu, May 3, 2012 at 6:11 PM, Yaw Anokwa wrote:

You can use relevancy to do this sort of thing. That is make an output
prompt relevant if certain conditions are met. The catch here is that
you have to make an exhaustive list of all the possibilities.

On Thu, May 3, 2012 at 6:05 PM, Jerry3904 stormyjerry@gmail.com wrote:

Thanks for the response, Yaw.

Normally, I do this in the "backend" (a spreadsheet), and collect just
the parameters in the field, and maybe that is what I will end up
doing here. But for practical reasons it would be very helpful to
have the returned value on the screen.

In my case, I am using an array that returns a Tree Risk rating from
the intersection of the parameters "Likelihood" and "Consequences." I
have put in a field for each of those parameters with 4 values for
each defined on the choices worksheet (e.g., good, bad, ugly, null).
The first parameter then should be used to set the row to look at in
the reference array, and the second the column, with the content of
the cell at the intersection being returned.

Thus, for example, if ${Likelihood}="unlikely" and ${Consequences}
="minor" then ${Risk}="Low." It seems to me that this would be a very
useful general function for ODK Collect if it could be worked out. I
am going to fiddle around with some relevant statements--can they be
nested--to see if anything starts to work.

Hope this makes things clearer, though maybe not...

On May 3, 7:16 pm, Yaw Anokwa yano...@gmail.com wrote:

Don't think you can. If you give us a description of the specific end
goal, we might have some ideas.

On Thu, May 3, 2012 at 3:39 PM, Jerry3904 StormyJe...@gmail.com wrote:

I have not seen this in the documentation or in the XLSForm, so am
posting
it here--sorry if I just missed it somewhere.

I need to have the content of one field set the row of a primary
array, then
a second field sets the column using an small auxillary array, and the
result is returned from the primary array into a third field. In
Excel, I
do this with a double use of vlookup, so it looks something vaguely
like
this:

=vlookup(cell1, array1, vlookup(cell2, array2,2))

Can something similar be done in ODK?

TIA

Jerry

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options:http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

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

That looks pretty neat...and pretty difficult for me. But I will give it a
try, and appreciate very much the suggestion.

Jerry

··· On Friday, May 4, 2012 1:00:15 PM UTC-4, Mitch wrote: > > Here's a solution that leverages Clayton's itext inverse-label display > technique described on this thread ( > http://groups.google.com/group/opendatakit/browse_thread/thread/c44f26680ac866ce/c64809383e3a3146). > > Basically, put the answers into the itext mapping, then construct the name > of the itext entry from your data values, and retrieve the answer via the > jr:itext() call. > > http://www.cs.washington.edu/homes/msundt/lookup/ > > Mitch > > On Thu, May 3, 2012 at 6:11 PM, Yaw Anokwa wrote: > >> You can use relevancy to do this sort of thing. That is make an output >> prompt relevant if certain conditions are met. The catch here is that >> you have to make an exhaustive list of all the possibilities. >> >> On Thu, May 3, 2012 at 6:05 PM, Jerry3904 wrote: >> > Thanks for the response, Yaw. >> > >> > Normally, I do this in the "backend" (a spreadsheet), and collect just >> > the parameters in the field, and maybe that is what I will end up >> > doing here. But for practical reasons it would be very helpful to >> > have the returned value on the screen. >> > >> > In my case, I am using an array that returns a Tree Risk rating from >> > the intersection of the parameters "Likelihood" and "Consequences." I >> > have put in a field for each of those parameters with 4 values for >> > each defined on the choices worksheet (e.g., good, bad, ugly, null). >> > The first parameter then should be used to set the row to look at in >> > the reference array, and the second the column, with the content of >> > the cell at the intersection being returned. >> > >> > Thus, for example, if ${Likelihood}="unlikely" and ${Consequences} >> > ="minor" then ${Risk}="Low." It seems to me that this would be a very >> > useful general function for ODK Collect if it could be worked out. I >> > am going to fiddle around with some relevant statements--can they be >> > nested--to see if anything starts to work. >> > >> > Hope this makes things clearer, though maybe not... >> > >> > On May 3, 7:16 pm, Yaw Anokwa wrote: >> >> Don't think you can. If you give us a description of the specific end >> >> goal, we might have some ideas. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> On Thu, May 3, 2012 at 3:39 PM, Jerry3904 wrote: >> >> > I have not seen this in the documentation or in the XLSForm, so am >> posting >> >> > it here--sorry if I just missed it somewhere. >> >> >> >> > I need to have the content of one field set the row of a primary >> array, then >> >> > a second field sets the column using an small auxillary array, and >> the >> >> > result is returned from the primary array into a third field. In >> Excel, I >> >> > do this with a double use of vlookup, so it looks something vaguely >> like >> >> > this: >> >> >> >> > =vlookup(cell1, array1, vlookup(cell2, array2,2)) >> >> >> >> > Can something similar be done in ODK? >> >> >> >> > TIA >> >> >> >> > Jerry >> >> >> >> > -- >> >> > Post: opendatakit@googlegroups.com >> >> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> >> > Options:http://groups.google.com/group/opendatakit?hl=en >> > >> > -- >> > Post: opendatakit@googlegroups.com >> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> > Options: http://groups.google.com/group/opendatakit?hl=en >> >> -- >> Post: opendatakit@googlegroups.com >> Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> Options: http://groups.google.com/group/opendatakit?hl=en >> > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitchellsundt@gmail.com >