Select to view content in your preferred language

Calculation help

862
3
Jump to solution
06-05-2023 04:04 PM
MatthewMorehead
New Contributor II

I am trying to create a form to collect line-point intercept data within Survey 123. I have most of the meat done, I just need help with some calculations. I currently have the survey set up to collect multiple points of data with the begin repeat and end repeat functions. I need to be able to calculate PERCENT FOLIAR COVER by taking the total number of entries for my "TOP LAYER" field across the entire repeated survey then divide those over the total number of points sampled and multiply by 100 to get my average percent.

I need to do the same thing to determine PERCENT BARE GROUND, which is calculated by taking the total number of soil entries in the SOIL SURFACE question AND have no answers in the Top LAYER field, dividing the total number of points, and multiplying by 100. The same thing for PERCENT BASAL COVER, but it can include any entries with entries in the TOP LAYER or subsequent fields.

My XLSForm and an example of the data sheet I am trying to replicate are attached so you can see where I am at.

 

Thanks in advance for any help.

0 Kudos
1 Solution

Accepted Solutions
Nicole_Ueberschär
Esri Regular Contributor

I think this post has almost all you need https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-repeats/ba-p/89804... - you might have to add some logic with ifs around the calculations. Sometimes it's helpful to add some calculate fields to check for the intermediate results.

The SOIL_SURFACE question is the only required question in the repeat, right? This one you could use for counting the valid repeats so the first calculation could be

count(${TOP_LAYER}) div count(${SOIL_SURFACE}) *100

Maybe you need to add round() to get readable numbers.

For the percentage bare ground I would add a hidden field inside the repeat that populates based on if(${TOP_LAYER},'',${SOIL_SURFACE})  and then use count again on that new field (you could also do 0  if TOP_LAYER  and 1 if not and then use the sum function).

For the last one I am not 100% what you need to do but I think you will get there now.

 

View solution in original post

3 Replies
Nicole_Ueberschär
Esri Regular Contributor

I think this post has almost all you need https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-repeats/ba-p/89804... - you might have to add some logic with ifs around the calculations. Sometimes it's helpful to add some calculate fields to check for the intermediate results.

The SOIL_SURFACE question is the only required question in the repeat, right? This one you could use for counting the valid repeats so the first calculation could be

count(${TOP_LAYER}) div count(${SOIL_SURFACE}) *100

Maybe you need to add round() to get readable numbers.

For the percentage bare ground I would add a hidden field inside the repeat that populates based on if(${TOP_LAYER},'',${SOIL_SURFACE})  and then use count again on that new field (you could also do 0  if TOP_LAYER  and 1 if not and then use the sum function).

For the last one I am not 100% what you need to do but I think you will get there now.

 

DougBrowning
MVP Esteemed Contributor

Here is an example

Inside the repeat

DougBrowning_0-1686081033044.png

 

Then outside 

DougBrowning_1-1686081060274.png

I can get you the form ready to go just lmk.

DougBrowning
MVP Esteemed Contributor

I have a advanced LPI form that we have been perfecting for 5 years now. Reach out to me if intrested. 

We do some summary calcs in the form for the users as you describe.

DougBrowning_0-1686058912261.png

If you have a repeat like us you have to double count.  So inside the repeat and then again outside the repeat.  Pretty hard to explain here so each out to me.