Is there a pulldata() syntax or some other way to perform calculations on a specific/previous record or records within a repeat? I am trying to make a series of calculations that compare the values between sequential records in a repeat.
For example, I have a repeat for collecting data for trees adjacent to a sample location. For report formatting purposes, these need to be recorded in descending diameter (largest tree to smallest). Within the repeat I have two user-entry fields ${treespecies} and ${treediameter}.
I want to also include a note to alert the user if they enter a value larger than a value in a previous repeat. I was hoping to use the Relevant function with a formula along the lines of:
(${treediamater, [previous value]} >= ${treediamater, [current value]}).
Another useful alert would be for assigning values for unusually large trees, for example a warning if a tree diameter is more than double the average diameter across all repeat entries.
Solved! Go to Solution.
Hi Byron,
There currently isn't a direct method for accessing a previous repeat's value in another repeat.
Hi Byron,
There currently isn't a direct method for accessing a previous repeat's value in another repeat.
So after a repeat I get a decimal calculation, but I am not allowed to extract that value and use it in another calculation?
James,
I am only returning 0s and 1s from my calculation, yet it is a decimal between 0 and 1. I have attempted to edit the bind:type as well as the type to see if I insert int. or decimal and nothing seems to come back correct. Do you have any idea what I am doing wrong?
Thank you,
Rob
If you are for sure doing them in order then my trick listed here should work
Populate a field within a repeat from a previous entry within same repeat?
You can use sum and count across a repeat to handle your other question.
Hey Doug and James,
I have been working on this for about 4 months, and I can get the calculations I need from the repeat outside the repeat. Everything worked fine on that, and I can see the calculations value as a decimal in connect outside the repeat. I then want to use that decimal to use in one final calculation but for some reason it turns those decimal values into a 0 or a 1. I actually put the calculations in the 'label column' as well so in Connect I can actually see the values they are pulling and that is how I know they are using 0s and 1s. I would like to attach the file and have one of you look at it because I am utterly beat at this point.
Please let me know what you find! Your help would be much appreciated.
Rob
You did not attach anything.
Why do you have all of these as type text? Then you bind to int.
I would think just make the type in column 1 decimal. I think its getting confused as to what type it should be. Line 58 works since it is decimal.
Just a guess.