How to get the position of the current count in the repeat questions

I am trying to get the position of repeat count in such a way that I want to display the position in the body of the question inside a repeat.

For example, if the repeat is at position 1, I want to display “1st”, if the repeat is at position 2, I want to display “2nd” and so on, I created this with calculate question retrieving the position by using postion(…), but unfortuanately it was not working.

The calculate question that I used is called AvailPadPackSizes. I have also attached my xlsform. Looking forward to a help

Example.xlsx (30.2 KB)

This request can be ignored, I have figured out where the issues were coming from. In the if condition, the refrencing of IndexPosition should be ${IndexPosition}

1 Like

Thank you for sharing the solution to the entire community!

Hello everyone, I need help with a number of questions.
here are the facts:

  • I have 15 farms and I am only allowed to continue with 10 of the 15
  • I am offered to choose a random number between 10 and 99
  • To obtain the selection step I have to divide 15 by 10 and the whole part will be the selection step. in this case it is 1.

for the selection I do this:
res= modulo (random number, total exploitation)
if the res =0 then the first element pulled is the last record =15
for the rest of the draws
just add the step to res and compare with 15
If <15 then the 2nd draw would be the +res step. this is repeated in a loop until you have 10 draws
if >15 and the number of draws has not reached 10 then you have to subtract with the 15
result p