Calculation Question

650
4
Jump to solution
04-18-2022 02:30 PM
Alena
by
New Contributor III

How do I get the 100 from silt_total_estimated not to display in the output if nothing in the prior columns is entered to calculate the clay_sand_total? 

 

Alena_0-1650317031755.png

Thanks

0 Kudos
1 Solution

Accepted Solutions
abureaux
MVP Regular Contributor

Both answers will work. Ismael's answer will hide the question entirely, while Robert's will show the entry field but hide the result.

If we combine Robert and Ismael's answers, we get:

if(string-length(${clay_sand})>0,100-${clay_sand},0)

I haven't tested this, but should work. The field will likely only update after entering data into clay_sand and then tabbing to another field.

View solution in original post

4 Replies
RobertBorchert
Frequent Contributor III

have you tried a combination of the relevant column and the calculation column.

Try using an "if" statement in the calculation. 

 

https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm

 

0 Kudos
IsmaelChivite
Esri Notable Contributor

Attaching an example

Tips:

  • For the silt + sand question, instead of using the hidden question type, use an integer type and set the appearance to hidden
  • Use the esri::body:style column to show/hide the clay question

IsmaelChivite_0-1650379688515.png

 

abureaux
MVP Regular Contributor

Both answers will work. Ismael's answer will hide the question entirely, while Robert's will show the entry field but hide the result.

If we combine Robert and Ismael's answers, we get:

if(string-length(${clay_sand})>0,100-${clay_sand},0)

I haven't tested this, but should work. The field will likely only update after entering data into clay_sand and then tabbing to another field.

Alena
by
New Contributor III

Thank you @abureaux , @IsmaelChivite , @RobertBorchert! This helped immensely! I'm still trying to learn all the various ways to do calculations!  Examples really help me and the Survey123 help is very simplistic in their examples.  I really liked learning the different way to hide the fields.