Using the pow(value,power) function in nested repeats

11-26-2019 06:01 AM
Occasional Contributor

I have a calculation that I would like to do on figures that I am entering into a repeat function.

What I am trying to do is a survey that lets you measure the diameter of logs left in several 50m X 50m plots (hence the repeat for plots). In each plot, there will be several trees that need to be measured at two points on the log (hence the repeat for the logs). 

So, for each pair of calculations for the log, I need to multiply by the power of 2, and then do the same for each subsequent log repeat. These all need to be added up into a total at the end of all the log repeats. 

I then move onto the next plot and do the same. The calculations should be the same for the trees in this plot as well, and then added to the total of the first plot. This will continue until all trees in each plot have been captured.

The problem that I am having is that I have a nested repeat for the plots and trees within. I have the formula that I need to do the exponent calculations. It is pow(${lg1},2) + pow(${lg2},2). lg1 and lg2 are the two diameters that need to be captured for each tree. When i use this formula, it will calculate the correct result, but as soon as I move onto the next disappears. How do i retain this value, and add it onto the values from the next trees results.

I am probably explaining myself really badly, but i will link the original spreadsheet I am trying to emulate as well as the survey I am working on.

Thanks for the help


0 Kudos
1 Reply
MVP Notable Contributor

You need to add the pow(${lg1},2) + pow(${lg2},2) formula inside the log repeat - so line 23.  Then you can use sum() to add those us across the plot outside the log repeat but inside the plot repeat.

Right now you have the formula outside both repeats so it can only see the current value.  

If you search geonet someone was asking this same question a few months ago.  That will give you more also.

0 Kudos