Inaugural Form Friday: XLSForm & Excel's CONCATENATE function

Hi ODK community, in an effort to consolidate XLSForm design tips and
support into a reoccurring series, I’d like to start a semi-regular Friday
post – called ‘Form Friday’ which will discuss form design strategies,
techniques, tips, and helpful XLSForm information.

*I am not a developer – I’m an applied economist who uses ODK on a regular
basis. Most of my knowledge of form design has been derived in some manner
from this community. I don’t write XML – but that has not kept me from
creating XLSForms which capture complex survey modules using ODK Collect. *

*I propose a slow start to build momentum behind the 'Form Friday' series -
in 2016 I'll target one post a month, while we build up a roster
of contributors of brief form design tips, best practices, and the
occasional more in-depth form design examples. Ideally, in early 2017,
we’ll develop a core group with a regular schedule of 2 postings a month.
The inaugural 'Form Friday' post is below. *

FormFriday_Example_160916.xlsx (27.5 KB)

··· -----------------------------------------------------------------------------

*Form Friday: XLSForm & Excel's CONCATENATE function *

I’m often required to begin the design of lengthy XLSForms before the
questionnaire is finalized. Unlike some users, I need enumerators to be
able to cross-reference the form with a paper version of the questionnaire
or a field manual; I make sure all questions are clearly and accurately
labeled to facilitate this process. When questions are added or deleted, it
can be frustrating to go through and relabel in the ODKForm, especially
with multiple languages.

Excel’s ‘CONCATENATE’ provides an easy method to ensure the question
‘name’, is captured in the question 'label' and makes relabeling easier and
is less prone to error. An applied example is found in the attached form,
starting in row 29. When the variable name is the same as the question
number the ‘name’ can be concatenated with a ‘!label::Language’ to create
the actual ‘label’ for each language in the form (more on the ‘!label…’
naming convention below).

This also works well to construct the ‘type’ column – allowing for an easy
change of the question type. This is represented in column A, B, and C,
where column C is a concatenated expression of the inputs from column A and
column B. Note from the example that I highlight all columns which have
headings starting with a ‘!’ that are used to build a concatenated
expression.

Lastly – having column headings with “!” allows the form to be converted to
.xml (using XLSForm Offline https://gumroad.com/l/xlsform-offline)
without error messages – omitting these will result in errors! For those
who are obsessively tidy, save a ‘clean’ copy without these columns once
the form is finalized.

Using concatenate like this may not be efficient for short surveys, but I
have found it to be a time saver for longer surveys and surveys with
multiple languages. The idea of using concatenate in this manner was not
mine – h/t Brad Sagara.

*If you have related tips using the CONCATENATE function in while building
XLSForms, please reply to this post and share them with the community! *

Hello Went through your post and the form.
Good one.

Just one question.
What does the function position(..) do in calculate.
Did not get that one.

And good one counting the end repeat for number of repeats.
liked that one.

Hi Lloyd,

I didn't know about the "!column" trick. Super useful!

I use CONCATENATE to put the number of a question in a label because
it's often the case that folks will want to change the ordering.

Another Excel function I use is SUBSTITUTE because it is great for
naming forms in a consistent manner.

I've attached an example with both.

Yaw

my_form.xlsx (41.1 KB)

··· -- Need ODK consultants? Nafundi provides form design, server setup, in-field training, and software development for ODK. Go to https://nafundi.com to get started.

On Fri, Sep 16, 2016 at 1:45 PM, Lloyd Owen Banwart lloyd.banwart@gmail.com wrote:

Hi ODK community, in an effort to consolidate XLSForm design tips and
support into a reoccurring series, I’d like to start a semi-regular Friday
post – called ‘Form Friday’ which will discuss form design strategies,
techniques, tips, and helpful XLSForm information.

I am not a developer – I’m an applied economist who uses ODK on a regular
basis. Most of my knowledge of form design has been derived in some manner
from this community. I don’t write XML – but that has not kept me from
creating XLSForms which capture complex survey modules using ODK Collect.

I propose a slow start to build momentum behind the 'Form Friday' series -
in 2016 I'll target one post a month, while we build up a roster of
contributors of brief form design tips, best practices, and the occasional
more in-depth form design examples. Ideally, in early 2017, we’ll develop a
core group with a regular schedule of 2 postings a month. The inaugural
'Form Friday' post is below.


Form Friday: XLSForm & Excel's CONCATENATE function

I’m often required to begin the design of lengthy XLSForms before the
questionnaire is finalized. Unlike some users, I need enumerators to be able
to cross-reference the form with a paper version of the questionnaire or a
field manual; I make sure all questions are clearly and accurately labeled
to facilitate this process. When questions are added or deleted, it can be
frustrating to go through and relabel in the ODKForm, especially with
multiple languages.

Excel’s ‘CONCATENATE’ provides an easy method to ensure the question
‘name’, is captured in the question 'label' and makes relabeling easier and
is less prone to error. An applied example is found in the attached form,
starting in row 29. When the variable name is the same as the question
number the ‘name’ can be concatenated with a ‘!label::Language’ to create
the actual ‘label’ for each language in the form (more on the ‘!label…’
naming convention below).

This also works well to construct the ‘type’ column – allowing for an easy
change of the question type. This is represented in column A, B, and C,
where column C is a concatenated expression of the inputs from column A and
column B. Note from the example that I highlight all columns which have
headings starting with a ‘!’ that are used to build a concatenated
expression.

Lastly – having column headings with “!” allows the form to be converted to
.xml (using XLSForm Offline) without error messages – omitting these will
result in errors! For those who are obsessively tidy, save a ‘clean’ copy
without these columns once the form is finalized.

Using concatenate like this may not be efficient for short surveys, but I
have found it to be a time saver for longer surveys and surveys with
multiple languages. The idea of using concatenate in this manner was not
mine – h/t Brad Sagara.

If you have related tips using the CONCATENATE function in while building
XLSForms, please reply to this post and share them with the community!

--

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.

In this use, the 'position(..)' calculation provides the number for the
current Nth repeat. In this example, if there were 5 household members, the
first ${mem} would have a value of 1, second ${mem} a value of
2...fifth ${mem} a value of 5.

This calculation is used on 'note5' (row 26) in the label -- "Household
Member Number ${mem}"

··· On Tuesday, September 20, 2016 at 2:02:11 PM UTC-4, dinee....@gmail.com wrote: > > Hello Went through your post and the form. > Good one. > > Just one question. > What does the function position(..) do in calculate. > Did not get that one. > > And good one counting the end repeat for number of repeats. > liked that one.