How to reference fields in a looped group in calculator

Hi,

I want to multiply some fields inside a repeatable (looped) group and give its answer in a fields which is also inside the same group.

for example, the repeatable group comprises of value1, value2 and product. I want to compute the result of value1 and value2 in the product field.

I have tried using this
calculate="/data/value1 * /data/value2"
in the binding of nodeset product, but its not working.

I want to repeat the group for several values, so I am using repeatable group.
How can I do that?

The reference should probably be /data/group/value1, not /data/value1.

Yaw

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

On Wed, Dec 18, 2013 at 3:28 AM, shabbir87.2007@gmail.com wrote:

Hi,

I want to multiply some fields inside a repeatable (looped) group and give its answer in a fields which is also inside the same group.

for example, the repeatable group comprises of value1, value2 and product. I want to compute the result of value1 and value2 in the product field.

I have tried using this
calculate="/data/value1 * /data/value2"
in the binding of nodeset product, but its not working.

I want to repeat the group for several values, so I am using repeatable group.
How can I do that?

--

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/groups/opt_out.

Since this is a repeated group, you likely need to use a relative reference
(assuming the calculate field is within that group)

calculate="../value1 * ../value2"

Note that there are many limitations and problems with repeat groups, and
XLSForm's automatic use of a full path name when referencing a field (
${fieldname} expansion) generally does not work well within repeat groups.

Mitch

··· On Fri, Dec 20, 2013 at 3:13 AM, Yaw Anokwa wrote:

The reference should probably be /data/group/value1, not /data/value1.

Yaw

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

On Wed, Dec 18, 2013 at 3:28 AM, shabbir87.2007@gmail.com wrote:

Hi,

I want to multiply some fields inside a repeatable (looped) group and
give its answer in a fields which is also inside the same group.

for example, the repeatable group comprises of value1, value2 and
product. I want to compute the result of value1 and value2 in the product
field.

I have tried using this
calculate="/data/value1 * /data/value2"
in the binding of nodeset product, but its not working.

I want to repeat the group for several values, so I am using repeatable
group.
How can I do that?

--

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/groups/opt_out.

--

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/groups/opt_out.

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