Forum › Forums › Unipark › Plausibility check: sum › Reply To: Plausibility check: sum
Lets assume that Q006 is v_6
, Q006a is v_7
and Q006b is v_8
. All questions must be on the same page, if the questions are all on their own page, you can only show the error message on the last page of the three pages.
If the questions are on different pages, go to the last page of the group, else go to the page where all three questions are.
In the left menu should be something like plausibility checks
(4th from the top). Go there, click on the grey +Plausicheck
button at the top, give it a meaningful name and click on next. Leave the top settings as they are (or modify if you need to), and in the lower definition
block choose one variable (no matter which one, we will overwrite in the next step) and click save
. Then click pro editor
above the title
and then paste the following text in the plausibility check meta code editor
:
if (v_7 + v_8 > v6 )
print "The sum of female workers (your entry: #v_7#) and male workers (your entry: #v_8#) is bigger than the total number of workers (your entry: #v_6#)";
NOT TESTED – but should work 🙂