# Calculation

Hi, I am trying to do the automatic calculation in the field "total combined code".

1. Province code has two digits (eg. 02)
2. District code has two digits (eg. 09)
3. Commune code has two digits (eg. 04)
4. Village code has two digits (eg. 03)
5. The total combined code has eight digits which combine the two digits of province code, two digits of district code, two digits of commune code, and two digits of village code. (eg. 02090403)

Is there any possibility to make it appears automatically in the field "total combined code"?

Thank you very much!

Kimchhoy

Kimchhoy,

What you want is the concat() function. If you are using XLSForm for form
design, you would add a "calculate" field with something like this in its
"calculation" column:

concat(\${province}, \${district}, \${commune}, \${village})

That assumes that you already have the four individual codes in fields by
those names, but you get the idea...

Best,

Chris

··· --- Christopher Robert Dobility, Inc. (SurveyCTO) http://www.surveycto.com/ http://blog.surveycto.com/

On Wed, May 6, 2015 at 4:44 AM kimchhoypkc@gmail.com wrote:

Hi, I am trying to do the automatic calculation in the field "total
combined code".

1. Province code has two digits (eg. 02)
2. District code has two digits (eg. 09)
3. Commune code has two digits (eg. 04)
4. Village code has two digits (eg. 03)
5. The total combined code has eight digits which combine the two digits
of province code, two digits of district code, two digits of commune code,
and two digits of village code. (eg. 02090403)

Is there any possibility to make it appears automatically in the field
"total combined code"?

Thank you very much!

Kimchhoy

## --

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