Please help me how to handle "Filtering By Question Answer" from the repeating group

Please help me how to handle "Filtering By Question Answer"

I am experiencing hard time at "Filtering By Question Answer" of repeating
group.

First, I investigated number of household members from a respondent.

Second, I opened the repeating group and started to ask several questions
for each household members including a question about relation to the
respondent and assigned ID to each.

Third, after I finished the questions of the repeating group, I wanted to
display the house hold ID whose relation is "son" from the repeating group.

So, I opened a hidden value and I put the command /data/repeat
group[relation='son']/ID[0] into the calculate condition. After that I open
the label question and let the hidden value be displayed. But finally
nothing displayed!!

Do you know How I can display ID whose relation is "son"?

Hello,

Its hard to know exactly what the issue is without seeing the entire XML
structure of your form. To debug, you could try adding different parts of
your expression as output values in some label question for the purposes of
debugging (as it seems you've already done). Use the count() function where
necessary (IE take the count() of /data/repeat group/relation to see if
that expression is correct).

I might also recommend an alternative architecture. If you add another
value called EG son_id then you could have the display condition only be
true in the event that the current repeat is a son. Then, this value would
only exist for sons, and you could have a path directly to the value IE
/data/repeat group/son_id. This would obviate the need for the predicate
expression which is often the source of problems here.

Best,
Will

··· On Mon, Jun 8, 2015 at 2:59 PM Yong-Hyun Nam wrote:

Please help me how to handle "Filtering By Question Answer"

I am experiencing hard time at "Filtering By Question Answer" of repeating
group.

First, I investigated number of household members from a respondent.

Second, I opened the repeating group and started to ask several questions
for each household members including a question about relation to the
respondent and assigned ID to each.

Third, after I finished the questions of the repeating group, I wanted to
display the house hold ID whose relation is "son" from the repeating group.

So, I opened a hidden value and I put the command /data/repeat
group[relation='son']/ID[0] into the calculate condition. After that I open
the label question and let the hidden value be displayed. But finally
nothing displayed!!

Do you know How I can display ID whose relation is "son"?

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

Thank you very much for your fast reply.

However, It is not too clear for me.

So I entreat you to let me know the solution of the question below

--> After finish a repeating group, I want to display the first name who
answered the relation question in the repeating group as "son"..

But it doesnt work that in the label
question outside the repeating group. Nothing appears in the label question.

Is there another way to display the first name who answered the relation
question in the repeating group as "son"?

··· On Monday, June 8, 2015 at 10:48:16 PM UTC+3, William Pride wrote: > > Hello, > > Its hard to know exactly what the issue is without seeing the entire XML > structure of your form. To debug, you could try adding different parts of > your expression as output values in some label question for the purposes of > debugging (as it seems you've already done). Use the count() function where > necessary (IE take the count() of /data/repeat group/relation to see if > that expression is correct). > > I might also recommend an alternative architecture. If you add another > value called EG son_id then you could have the display condition only be > true in the event that the current repeat is a son. Then, this value would > only exist for sons, and you could have a path directly to the value IE > /data/repeat group/son_id. This would obviate the need for the predicate > expression which is often the source of problems here. > > Best, > Will > > > > On Mon, Jun 8, 2015 at 2:59 PM Yong-Hyun Nam <nyh...@gmail.com > wrote: > >> >> Please help me how to handle "Filtering By Question Answer" >> >> I am experiencing hard time at "Filtering By Question Answer" of >> repeating group. >> >> >> First, I investigated number of household members from a respondent. >> >> Second, I opened the repeating group and started to ask several questions >> for each household members including a question about relation to the >> respondent and assigned ID to each. >> >> Third, after I finished the questions of the repeating group, I wanted to >> display the house hold ID whose relation is "son" from the repeating group. >> >> So, I opened a hidden value and I put the command /data/repeat >> group[relation='son']/ID[0] into the calculate condition. After that I open >> the label question and let the hidden value be displayed. But finally >> nothing displayed!! >> >> Do you know How I can display ID whose relation is "son"? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "commcare-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to commcare-user...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> >