I would like to have 9 respondents for one brand, 17 respondents for another brand, etc. and each one of them in a different segment (each segment defined by an array). I would like to weed out all respondents that choose a brand after the amount of respondents for the brand is fulfilled. To do this, I created a question SC03 with 2 = brand one, 3 = brand two, etc. I am getting an error message every time I go throgh the questionnaire. How could I fix the code in order to fulfill my purposes? Thank you!
$test = value('SC03');
$cdvlimits = array(
2 => 9,
3 => 17,
4 => 12,
5 => 6,
6 => 5,
7 => 6,
8 => 15,
9 => 65
);
$blimits = array(
11 => 12,
12 => 30,
13 => 20,
14 => 17,
15 => 7,
16 => 19,
17 => 90
);
$climits = array(
19 => 8,
20 => 22,
21 => 13,
22 => 12,
23 => 27,
24 => 8,
25 => 8,
26 => 11,
27 => 11
);
$nQnr = statistic('count', 'SC03', $test);
$cdvnMax = $cdvlimits[$test];
$bnMax = $blimits[$test];
$cnMax = $climits[$test];
if ($nQnr >= $cdvnMax) {
goToPage('end');
}
if ($nQnr >= $bnMax) {
goToPage('end');
}
if ($nQnr >= $cnMax) {
goToPage('end');
}