Choice-filter in a loop - with condition based on position

Welcome @paolagomez!
Could you provide an extract of your form, please?
I trust the form was checked already with the online validator.

Maybe select_from_repeat can also help you. See Select-one-from-repeats not supported in KoBoToolbox - #9 by Kal_Lam
(If you use it, pretest the data export also.)

And using the search function of the forum you will find other examples for similar select demands. See https://community.kobotoolbox.org/search?context=topic&context_id=37827&q=choice%20filter%20loop&skip_context=true.

But there seem to be few unsolved bugs with repeats also, see https://github.com/enketo/enketo-core/issues/847.