Hi,
Have a survey with a repeat. We'd like to calculate the position of each repeat so that becomes the ID. e.g.
repeat
ID
ID name
End repeat
Gives an outcome like
We can use the position(..) calculation to calculate the ID number within the repeat.
If a user collecting data deletes a repeat, we could use the Once(position(..)) calculation to prevent the ID from changing. However, a new repeat will potentially re-use the same position value. e.g. for the above scenario, if we remove the second repeat entry and entry a new one, the table will look like:
We can't re-calculate all the IDs as they are referenced in questions later on in the survey.
We want the re-entry to take the 4th position. So looking for ways we could resolve this e.g.
- Different calculation method for position(..)
- Prevent users from deleting repeat entries
- External calculation/function to track highest value entered across repeat IDs and then +1 into new repeat (without somehow causing a loop)
- Other suggestions
@DougBrowning @IsmaelChivite would really appreciate your eyes on this one 🙂
Cheers