Select to view content in your preferred language

Survey123: how to perform simple calculations using values from multiple prior questions/fields

9385
2
07-08-2016 11:46 AM
RobinMulvey
Emerging Contributor

I'm building a survey in Survey123. I want to calculate using two prior fields but cannot find examples of proper syntax. In my situation, I'd like to calculate the total crown height by substracting the height of the lower crown from the height of the tree. The example that I have seen is a tip calculation based on just one prior question/field. If anyone can offer syntax guidance relevant to simple calculations using multiple fields/questions, I'd appreciate it!

0 Kudos
2 Replies
IsmaelChivite
Esri Notable Contributor

int(${TotalTreeHeight}) - int(${LowCrownHeight})

Check this help topic for more details: Formulas—Survey123 for ArcGIS | ArcGIS

LAG155
by
Occasional Contributor

Estamos realizando un cálculo con dos campos decimales, pero necesitamos agregar una condicional con los siguientes parámetros: cuando el resultado de la división sea un valor NaN necesitamos que en el campo calculado se escriba un "0". 

cuando la división es 0/20 el resultado es 0, pero cuando es 20/0 nos deja el campo vació, y necesitamos que se refleje un 0.

0 Kudos