Find min value

Discussions about CSEntry
Post Reply
BK Singh
Posts: 18
Joined: April 11th, 2023, 11:13 am

Find min value

Post by BK Singh »

Hi Sir,

I have roaster where I am capturing women's children details. There we are capturing age and health checkup detail for every child. After filling these details we have sets of question for last child(youngest child of women) who has got checked up or not. In condition when the last child got checked up I want to skip question related to "not got checked up" and in condition last child not got checked up I want to skip question related to "got checked up"
Now please suggest logic to find the last child has got check up or not. That means logic to check last child of woman and last child checkup detail from roster
justinlakier
Posts: 152
Joined: November 21st, 2022, 4:41 pm

Re: Find min value

Post by justinlakier »

For every child in a roster, you should already have the age and health checkup details. Whichever child has the lowest age in the roster will be the last child. You can find the index of the last child using SeekMin(AGE). Once you have that index, you can use it to look at the health checkup details for that last child, where you should have the details of whether they have been checked up or not. If this was not initially recorded in the roster details, then it should be an option while entering health checkup details for every child, either as its own question ("checked up" as a yes/no variable) or as an option for an existing question. When asking this next set of questions only for the last child, you can refer back to the last child's indexed checkup details to get or calculate the checked up/not checked up value. For these new questions (either in each individual preproc or in a block preproc for multiple questions) you can then use an ask-if, skip or other control, and only ask the set of questions which matches the checked-up status found in the last child's details.

Hope that helps,
Justin
BK Singh
Posts: 18
Joined: April 11th, 2023, 11:13 am

Re: Find min value

Post by BK Singh »

Thank you.
Post Reply