Hi everyone ![]()
Hope you’are all good !
Thanks again for all the support I receive last month ! This is terrific for us and our research project !
I’m back with a new puzzle to solve ![]()
Here is what my questionnaire looks like :
Begin repeat 1 : recording all places of activity
Q1 => enter a place of activity (text)
Q2 => placement-map of the place (geopoint)
Q3 => what kind of place is it (Work, University, School, other) ? (select_one)
End repeat 1
Begin repeat 2 : chain of displacement (or movement chain)
Q4 => what are the steps of this chain ? (map appearance, choosing geopoints from Q2)
End repeat 2
Q6 => control of consistency (note message)
My question is about Q6 : I would like to control the consistency between the first repeat and Q4 (places selected in the second repeat).
Something like : if in Q3, "work" has been selected once, at least one geopoint associated to "work" has to be selected in Q4.
The goal here is to make sure the respondent hasn't forgotten to include any locations in the second repeat. Do you think it’s possible ?
Here is the logic from a first attempt with AI support :
Inside repeat 1 => calculate | is_work | if(${q3} = 'work', 1, 0)
Outside repeat 1 => calculate | work_count | sum(${is_work})
Inside repeat 2 => calculate | is_work_selected | if(${places}[./q2 = ${q4}][position()=1]/q3 = 'work', 1, 0)
And eventually, for Q6 => if(${work_count} = ${work_in_chain_count},
'Consistent ✓', 'Not consistent')
The problem with this is the ‘inside repeat 2’ calculation expression, it doesn’t work at all ! But maybe it’s not so far from achieving something ? I don’t know !
Here is the file
Essai_control_consistency.xlsx (14.5 KB)