Is it possible to have maths?

I would like to create a fields where mathematical operations are done
with two fields, say add two fields together, and the answer should
then enable certain questions. Is it possible? If possible, how do I
go about it?

Thanks

To answer myself. I did it by editing the XML file itself after
studying Purcforms XML after a calculation. But for a beginner like me
it may too daunting a task, but at least I got some idea. Is there an
easier way?
BTW the Purcforms form does not run on my phone, it chrashed when I
scrolled to the display for the result.

···

On Nov 2, 2:09 pm, Bergie <bergi...@gmail.com> wrote:

I would like to create a fields where mathematical operations are done
with two fields, say add two fields together, and the answer should
then enable certain questions. Is it possible? If possible, how do I
go about it?

Thanks

Yeah, there is the “Calculate” function.

you can use the calculate attribute in your bind.

Now the node “sum” will contain the calculated value.

this answer was provided in a past thread by Yaw from ODK, and I searched the ODK mailing list to see if there was something relevant to “calculate”, which will bring you a lot of examples.

~Neil

···

On Wed, Nov 2, 2011 at 9:27 AM, Bergie bergi...@gmail.com wrote:

To answer myself. I did it by editing the XML file itself after

studying Purcforms XML after a calculation. But for a beginner like me

it may too daunting a task, but at least I got some idea. Is there an

easier way?

BTW the Purcforms form does not run on my phone, it chrashed when I

scrolled to the display for the result.

On Nov 2, 2:09 pm, Bergie bergi...@gmail.com wrote:

I would like to create a fields where mathematical operations are done

with two fields, say add two fields together, and the answer should

then enable certain questions. Is it possible? If possible, how do I

go about it?

Thanks

You received this message because you are subscribed to the Google Groups “Kobo Users” group.

To post to this group, send email to kobo-...@googlegroups.com.

To unsubscribe from this group, send email to kobo-users+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/kobo-users?hl=en.

Thank you, this is exactly what I did. Purcforms have the build in
function to add calculations, that is how I got to get it right. Will
you in future support it form the builder?

A variant I am looking at is to use data from a previous instance as
well. For say a survey I am in suburb "LoonyVille." At the start of
the first form I enter "Looneyville," then street/block etc. Now I
will likely be in Loonyville for the next 50 or so forms, will it be
possible to make the second forms to default value to whatever was
filled in the first form?
Regards

···

On Nov 2, 5:46 pm, Neil Hendrick <neil.h...@kobotoolbox.org> wrote:

Yeah, there is the "Calculate" function.

you can use the calculate attribute in your bind.

<bind nodeset="/data/sum" calculate="/data/number1 + /data/number2"/>

Now the node "sum" will contain the calculated value.

this answer was provided in a past thread by Yaw from ODK, and I searched
the ODK mailing list to see if there was something relevant to "calculate",
which will bring you a lot of examples.

~Neil

On Wed, Nov 2, 2011 at 9:27 AM, Bergie <bergi...@gmail.com> wrote:
> To answer myself. I did it by editing the XML file itself after
> studying Purcforms XML after a calculation. But for a beginner like me
> it may too daunting a task, but at least I got some idea. Is there an
> easier way?
> BTW the Purcforms form does not run on my phone, it chrashed when I
> scrolled to the display for the result.

> On Nov 2, 2:09 pm, Bergie <bergi...@gmail.com> wrote:
> > I would like to create a fields where mathematical operations are done
> > with two fields, say add two fields together, and the answer should
> > then enable certain questions. Is it possible? If possible, how do I
> > go about it?

> > Thanks

> --
> You received this message because you are subscribed to the Google Groups
> "Kobo Users" group.
> To post to this group, send email to kobo-...@googlegroups.com.
> To unsubscribe from this group, send email to
> kobo-users+...@googlegroups.com.
> For more options, visit this group at
>http://groups.google.com/group/kobo-users?hl=en.

The ability to import data to a survey from previous surveys or from a database is something that is on our development roadmap, so we will be looking to do the kind of Loonyville scenario you have described. Currently, all surveys start as blanks.

☞§※☼:airplane::open_umbrella::slight_smile:

~Neil

···

On Thu, Nov 3, 2011 at 6:58 AM, Bergie bergi...@gmail.com wrote:

Thank you, this is exactly what I did. Purcforms have the build in

function to add calculations, that is how I got to get it right. Will

you in future support it form the builder?

A variant I am looking at is to use data from a previous instance as

well. For say a survey I am in suburb “LoonyVille.” At the start of

the first form I enter “Looneyville,” then street/block etc. Now I

will likely be in Loonyville for the next 50 or so forms, will it be

possible to make the second forms to default value to whatever was

filled in the first form?

Regards

On Nov 2, 5:46 pm, Neil Hendrick neil.h...@kobotoolbox.org > > wrote:

Yeah, there is the “Calculate” function.

you can use the calculate attribute in your bind.

Now the node “sum” will contain the calculated value.

this answer was provided in a past thread by Yaw from ODK, and I searched

the ODK mailing list to see if there was something relevant to “calculate”,

which will bring you a lot of examples.

~Neil

On Wed, Nov 2, 2011 at 9:27 AM, Bergie bergi...@gmail.com wrote:

To answer myself. I did it by editing the XML file itself after

studying Purcforms XML after a calculation. But for a beginner like me

it may too daunting a task, but at least I got some idea. Is there an

easier way?

BTW the Purcforms form does not run on my phone, it chrashed when I

scrolled to the display for the result.

On Nov 2, 2:09 pm, Bergie bergi...@gmail.com wrote:

I would like to create a fields where mathematical operations are done

with two fields, say add two fields together, and the answer should

then enable certain questions. Is it possible? If possible, how do I

go about it?

Thanks

You received this message because you are subscribed to the Google Groups

“Kobo Users” group.

To post to this group, send email to kobo-...@googlegroups.com.

To unsubscribe from this group, send email to

kobo-users+...@googlegroups.com.

For more options, visit this group at

http://groups.google.com/group/kobo-users?hl=en.

You received this message because you are subscribed to the Google Groups “Kobo Users” group.

To post to this group, send email to kobo-...@googlegroups.com.

To unsubscribe from this group, send email to kobo-users+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/kobo-users?hl=en.