Addition operand in Survey123 XLS form

1890
3
Jump to solution
07-19-2016 12:55 PM
edmundzlonis
New Contributor

Addition operand in math formula results in concatenation rather than sum for numeric
values.  I am trying to sum 4 previous fields to confirm that they add up
to 1.0. The following formula ${EC} + ${FLC} + ${OWC} + ${ShC} results in a
concatenation (0.40.30.20.1), rather than a sum (1.0) of the fields. The other
operands all work correctly. In the Excel spreadsheet the name cells for the
select_one field (e.g., PropCover) are defined as numeric and the type for the
recipient cell (TotalCover) is decimal. When I use the form with this formula
in ODK Collector the addition operand works correctly. Am I missing something?
Thanks.

0 Kudos
1 Solution

Accepted Solutions
PhilipWilson-GIS
New Contributor III

Hi Edmund. You need to cast the fields as integers for them to sum correctly and not just concatenate. Your formula should look as follows:  int(${EC}) + int(${FLC}) + int(${OWC}) + int(${ShC})

Hope that helps. Phil.

View solution in original post

3 Replies
PhilipWilson-GIS
New Contributor III

Hi Edmund. You need to cast the fields as integers for them to sum correctly and not just concatenate. Your formula should look as follows:  int(${EC}) + int(${FLC}) + int(${OWC}) + int(${ShC})

Hope that helps. Phil.

bobwright
Occasional Contributor

Hi Phil,

How would you cast decimals? I tried dec and decimal, but got error messages. Thanks.

Bob

0 Kudos
IsmaelChivite
Esri Notable Contributor

Cross referencing response: Addition operand in Survey123 XLS form

0 Kudos