I am building a soil mapping survey and am having a problem with one of my calculations. I have repeat questions related to the soil's profile. Each repeat represents a soil horizon. Some of the properties that need to be captured is the Upper and Lower depths. What I am attempting to do is:
if HORIZON_NO = 1
UPPER = 0
else
UPPER = LOWER_MAX
LOWER_MAX is the max of the LOWER measurement recorded in the repeats. Essentially the first horizon will have an UPPER measure (depth) of 0. The second repeat or horizons will now automatically populate the upper to equal the previous lower. The code that I used is:
if (${HORIZON_NO}=1, 0, ${LOWER_MAX})

What ends up happening is that first repeat does not get a 0 and when I capture a second repeat it actually concatenates the 1 and 0 from my if statement.
