Allow only one wife/husband in a repeat group

Hello,

I am working on a Begin repeat section that ask about family data.
In the first question the enumerator selects one member of the family and
then some relevant questions follow.
What I need to enforce is that in the second or posterior sequences the
"husband" is not selected again, as there should be only one husband. The
same goes for the "wife", if the wife was already selected and defined the
user should not be able to input another wife. With sons there can be more
than one.

I guess I need to use index repeat but i haven't figure this out. Please
help.

Salut,

J'ai rencontré le même le problème dernièrement, mais avec le nombre de
chef de ménage dans un ménage. Comme tu le verras dans la pièce jointe, la
solution aurait était d'utiliser la fonction position() combinée à
index-repeat(). Malheureusement position() ne semble pas fonctionnelle.

Alors l'astuce adoptée a été de compter, après la saisie de tous les
membres du ménage, le nombre de chef de ménage et de retourner un message
d'avertissement si on a plus d'un chef de ménage. Lequel message invite
l'agent à vérifier et à corriger l'erreur. Pas très élégant, mais bon à
défaut de ce qu'on veut, on fait avec ce qu'on a.

Si tu réussis à améliorer ce formulaire ce serait sympa de le partager.

@+

test.xls (18 KB)

··· Le lundi 12 janvier 2015 04:55:37 UTC+1, jpardila a écrit : > > Hello, > > I am working on a Begin repeat section that ask about family data. > In the first question the enumerator selects one member of the family and > then some relevant questions follow. > What I need to enforce is that in the second or posterior sequences the > "husband" is not selected again, as there should be only one husband. The > same goes for the "wife", if the wife was already selected and defined the > user should not be able to input another wife. With sons there can be more > than one. > > I guess I need to use index repeat but i haven't figure this out. Please > help. >

C'est très simple d'avoir le chef de ménage comme le premier membre et
aucun autre membre ne peut être chef de ménage:

  1. tu crees une variable avec la fonction position()

type name label hint constraint calculate HR01 HR01: Numero de la
personne select_one HR02c HR02 HR02:relation ${HR00} avec le chef de
menage?
if(position(..)=1,${HR02}=1,${HR02}!='1')

··· Le 12 janvier 2015 19:43, Charles Mouté a écrit :

Salut,

J'ai rencontré le même le problème dernièrement, mais avec le nombre de
chef de ménage dans un ménage. Comme tu le verras dans la pièce jointe, la
solution aurait était d'utiliser la fonction position() combinée à
index-repeat(). Malheureusement position() ne semble pas fonctionnelle.

Alors l'astuce adoptée a été de compter, après la saisie de tous les
membres du ménage, le nombre de chef de ménage et de retourner un message
d'avertissement si on a plus d'un chef de ménage. Lequel message invite
l'agent à vérifier et à corriger l'erreur. Pas très élégant, mais bon à
défaut de ce qu'on veut, on fait avec ce qu'on a.

Si tu réussis à améliorer ce formulaire ce serait sympa de le partager.

@+

Le lundi 12 janvier 2015 04:55:37 UTC+1, jpardila a écrit :

Hello,

I am working on a Begin repeat section that ask about family data.
In the first question the enumerator selects one member of the family and
then some relevant questions follow.
What I need to enforce is that in the second or posterior sequences the
"husband" is not selected again, as there should be only one husband. The
same goes for the "wife", if the wife was already selected and defined the
user should not be able to input another wife. With sons there can be more
than one.

I guess I need to use index repeat but i haven't figure this out. Please
help.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yep. Cela marche si le chef de ménage est toujours à la position 1. A
l'instar de @jpardila, je n'aimerais pas contraindre la position, dans mon
cas, du chef de ménage. Je voudrais m'assurer que j'ai un et seul chef de
ménage par ménage. Si le contrôle étai possible pendant la saisie se serait
idéale, mais la fonction position() demeure éternellement à 1 même on entre
un dizaine de membre de ménage.

Charles Mouté
Demographer - Networks And Multimedias Applications Engineer
B.P. 8434 Yaoundé
Tél. (+237) 222 072 759 / (+237) 677 49 49 79
Skype : charlesmoute

image

image

image

··· Le 13 janvier 2015 13:55, Pierre Anthony Garraud a écrit :

C'est très simple d'avoir le chef de ménage comme le premier membre et
aucun autre membre ne peut être chef de ménage:

  1. tu crees une variable avec la fonction position()

type name label hint constraint calculate HR01 HR01: Numero de la
personne select_one HR02c HR02 HR02:relation ${HR00} avec le chef
de menage?
if(position(..)=1,${HR02}=1,${HR02}!='1')

Le 12 janvier 2015 19:43, Charles Mouté charlesmoute@gmail.com a écrit :

Salut,

J'ai rencontré le même le problème dernièrement, mais avec le nombre de
chef de ménage dans un ménage. Comme tu le verras dans la pièce jointe, la
solution aurait était d'utiliser la fonction position() combinée à
index-repeat(). Malheureusement position() ne semble pas fonctionnelle.

Alors l'astuce adoptée a été de compter, après la saisie de tous les
membres du ménage, le nombre de chef de ménage et de retourner un message
d'avertissement si on a plus d'un chef de ménage. Lequel message invite
l'agent à vérifier et à corriger l'erreur. Pas très élégant, mais bon à
défaut de ce qu'on veut, on fait avec ce qu'on a.

Si tu réussis à améliorer ce formulaire ce serait sympa de le partager.

@+

Le lundi 12 janvier 2015 04:55:37 UTC+1, jpardila a écrit :

Hello,

I am working on a Begin repeat section that ask about family data.
In the first question the enumerator selects one member of the family
and then some relevant questions follow.
What I need to enforce is that in the second or posterior sequences the
"husband" is not selected again, as there should be only one husband. The
same goes for the "wife", if the wife was already selected and defined the
user should not be able to input another wife. With sons there can be more
than one.

I guess I need to use index repeat but i haven't figure this out. Please
help.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the
Google Groups "ODK Community" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit/2x6ZoidAbgI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

J'aimerais savoir, @Pierre, chez toi la fonction position retourne-t-elle
la valeur de l'incrément actuel ? Donc si t'es à la troisième itération,
est-ce que position()=3 ?

Charles Mouté
Demographer - Networks And Multimedias Applications Engineer
B.P. 8434 Yaoundé
Tél. (+237) 222 072 759 / (+237) 677 49 49 79
Skype : charlesmoute

image

image

image

··· Le 13 janvier 2015 15:33, Charles Mouté a écrit :

Yep. Cela marche si le chef de ménage est toujours à la position 1. A
l'instar de @jpardila, je n'aimerais pas contraindre la position, dans
mon cas, du chef de ménage. Je voudrais m'assurer que j'ai un et seul chef
de ménage par ménage. Si le contrôle étai possible pendant la saisie se
serait idéale, mais la fonction position() demeure éternellement à 1 même
on entre un dizaine de membre de ménage.

Charles Mouté
Demographer - Networks And Multimedias Applications Engineer
B.P. 8434 Yaoundé
Tél. (+237) 222 072 759 / (+237) 677 49 49 79
Skype : charlesmoute

Le 13 janvier 2015 13:55, Pierre Anthony Garraud pagarraud1@gmail.com a
écrit :

C'est très simple d'avoir le chef de ménage comme le premier membre et
aucun autre membre ne peut être chef de ménage:

  1. tu crees une variable avec la fonction position()

type name label hint constraint calculate HR01 HR01: Numero de la
personne select_one HR02c HR02 HR02:relation ${HR00} avec le chef
de menage?
if(position(..)=1,${HR02}=1,${HR02}!='1')

Le 12 janvier 2015 19:43, Charles Mouté charlesmoute@gmail.com a écrit
:

Salut,

J'ai rencontré le même le problème dernièrement, mais avec le nombre de
chef de ménage dans un ménage. Comme tu le verras dans la pièce jointe, la
solution aurait était d'utiliser la fonction position() combinée à
index-repeat(). Malheureusement position() ne semble pas fonctionnelle.

Alors l'astuce adoptée a été de compter, après la saisie de tous les
membres du ménage, le nombre de chef de ménage et de retourner un message
d'avertissement si on a plus d'un chef de ménage. Lequel message invite
l'agent à vérifier et à corriger l'erreur. Pas très élégant, mais bon à
défaut de ce qu'on veut, on fait avec ce qu'on a.

Si tu réussis à améliorer ce formulaire ce serait sympa de le partager.

@+

Le lundi 12 janvier 2015 04:55:37 UTC+1, jpardila a écrit :

Hello,

I am working on a Begin repeat section that ask about family data.
In the first question the enumerator selects one member of the family
and then some relevant questions follow.
What I need to enforce is that in the second or posterior sequences the
"husband" is not selected again, as there should be only one husband. The
same goes for the "wife", if the wife was already selected and defined the
user should not be able to input another wife. With sons there can be more
than one.

I guess I need to use index repeat but i haven't figure this out.
Please help.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google
Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the
Google Groups "ODK Community" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit/2x6ZoidAbgI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Salut Charles,

Cela marche, et c'est très important de restreindre la position du chef de
ménage pour faciliter la solution du probleme

Je vais jeter un coup d'oeil dans votre fichier test.
Et je vous revient

Pierre

image

image

image

··· Le 13 janvier 2015 06:46, Charles Mouté a écrit :

J'aimerais savoir, @Pierre, chez toi la fonction position retourne-t-elle
la valeur de l'incrément actuel ? Donc si t'es à la troisième itération,
est-ce que position()=3 ?

Charles Mouté
Demographer - Networks And Multimedias Applications Engineer
B.P. 8434 Yaoundé
Tél. (+237) 222 072 759 / (+237) 677 49 49 79
Skype : charlesmoute

Le 13 janvier 2015 15:33, Charles Mouté charlesmoute@gmail.com a écrit :

Yep. Cela marche si le chef de ménage est toujours à la position 1. A
l'instar de @jpardila, je n'aimerais pas contraindre la position, dans
mon cas, du chef de ménage. Je voudrais m'assurer que j'ai un et seul chef
de ménage par ménage. Si le contrôle étai possible pendant la saisie se
serait idéale, mais la fonction position() demeure éternellement à 1 même
on entre un dizaine de membre de ménage.

Charles Mouté
Demographer - Networks And Multimedias Applications Engineer
B.P. 8434 Yaoundé
Tél. (+237) 222 072 759 / (+237) 677 49 49 79
Skype : charlesmoute

Le 13 janvier 2015 13:55, Pierre Anthony Garraud pagarraud1@gmail.com a écrit :

C'est très simple d'avoir le chef de ménage comme le premier membre et
aucun autre membre ne peut être chef de ménage:

  1. tu crees une variable avec la fonction position()

type name label hint constraint calculate HR01 HR01: Numero de la
personne select_one HR02c HR02 HR02:relation ${HR00} avec le
chef de menage?
if(position(..)=1,${HR02}=1,${HR02}!='1')

Le 12 janvier 2015 19:43, Charles Mouté charlesmoute@gmail.com a
écrit :

Salut,

J'ai rencontré le même le problème dernièrement, mais avec le nombre de
chef de ménage dans un ménage. Comme tu le verras dans la pièce jointe, la
solution aurait était d'utiliser la fonction position() combinée à
index-repeat(). Malheureusement position() ne semble pas fonctionnelle.

Alors l'astuce adoptée a été de compter, après la saisie de tous les
membres du ménage, le nombre de chef de ménage et de retourner un message
d'avertissement si on a plus d'un chef de ménage. Lequel message invite
l'agent à vérifier et à corriger l'erreur. Pas très élégant, mais bon à
défaut de ce qu'on veut, on fait avec ce qu'on a.

Si tu réussis à améliorer ce formulaire ce serait sympa de le partager.

@+

Le lundi 12 janvier 2015 04:55:37 UTC+1, jpardila a écrit :

Hello,

I am working on a Begin repeat section that ask about family data.
In the first question the enumerator selects one member of the family
and then some relevant questions follow.
What I need to enforce is that in the second or posterior sequences
the "husband" is not selected again, as there should be only one husband.
The same goes for the "wife", if the wife was already selected and defined
the user should not be able to input another wife. With sons there can be
more than one.

I guess I need to use index repeat but i haven't figure this out.
Please help.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google
Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the
Google Groups "ODK Community" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit/2x6ZoidAbgI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Okay. Merci.

··· -------- Charles Mouté Informaticien & Démographe B.P. 8434 Yaoundé Tél. (+237) 77494979 Skype : charlesmoute

Le 13 janv. 2015 à 16:39, Pierre Anthony Garraud pagarraud1@gmail.com a écrit :

Salut Charles,

Cela marche, et c'est très important de restreindre la position du chef de ménage pour faciliter la solution du probleme

Je vais jeter un coup d'oeil dans votre fichier test.
Et je vous revient

Pierre

Le 13 janvier 2015 06:46, Charles Mouté charlesmoute@gmail.com a écrit :

J'aimerais savoir, @Pierre, chez toi la fonction position retourne-t-elle la valeur de l'incrément actuel ? Donc si t'es à la troisième itération, est-ce que position()=3 ?

Charles Mouté
Demographer - Networks And Multimedias Applications Engineer
B.P. 8434 Yaoundé
Tél. (+237) 222 072 759 / (+237) 677 49 49 79
Skype : charlesmoute

Le 13 janvier 2015 15:33, Charles Mouté charlesmoute@gmail.com a écrit :

Yep. Cela marche si le chef de ménage est toujours à la position 1. A l'instar de @jpardila, je n'aimerais pas contraindre la position, dans mon cas, du chef de ménage. Je voudrais m'assurer que j'ai un et seul chef de ménage par ménage. Si le contrôle étai possible pendant la saisie se serait idéale, mais la fonction position() demeure éternellement à 1 même on entre un dizaine de membre de ménage.

Charles Mouté
Demographer - Networks And Multimedias Applications Engineer
<01_b_house3.gif>B.P. 8434 Yaoundé
<14_a_phone4.gif>Tél. (+237) 222 072 759 / (+237) 677 49 49 79
<44_a_envelope5.gif>Skype : charlesmoute

Le 13 janvier 2015 13:55, Pierre Anthony Garraud pagarraud1@gmail.com a écrit :

C'est très simple d'avoir le chef de ménage comme le premier membre et aucun autre membre ne peut être chef de ménage:
tu crees une variable avec la fonction position()
type name label hint constraint
calculate HR01 HR01: Numero de la personne
select_one HR02c HR02 HR02:relation ${HR00} avec le chef de menage?
if(position(..)=1,${HR02}=1,${HR02}!='1')

Le 12 janvier 2015 19:43, Charles Mouté charlesmoute@gmail.com a écrit :

Salut,

J'ai rencontré le même le problème dernièrement, mais avec le nombre de chef de ménage dans un ménage. Comme tu le verras dans la pièce jointe, la solution aurait était d'utiliser la fonction position() combinée à index-repeat(). Malheureusement position() ne semble pas fonctionnelle.

Alors l'astuce adoptée a été de compter, après la saisie de tous les membres du ménage, le nombre de chef de ménage et de retourner un message d'avertissement si on a plus d'un chef de ménage. Lequel message invite l'agent à vérifier et à corriger l'erreur. Pas très élégant, mais bon à défaut de ce qu'on veut, on fait avec ce qu'on a.

Si tu réussis à améliorer ce formulaire ce serait sympa de le partager.

@+

Le lundi 12 janvier 2015 04:55:37 UTC+1, jpardila a écrit :

Hello,

I am working on a Begin repeat section that ask about family data.
In the first question the enumerator selects one member of the family and then some relevant questions follow.
What I need to enforce is that in the second or posterior sequences the "husband" is not selected again, as there should be only one husband. The same goes for the "wife", if the wife was already selected and defined the user should not be able to input another wife. With sons there can be more than one.

I guess I need to use index repeat but i haven't figure this out. Please help.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the Google Groups "ODK Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/opendatakit/2x6ZoidAbgI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the Google Groups "ODK Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/opendatakit/2x6ZoidAbgI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.