If you look in the file /components/com_bfsurvey_plus/controller.php in the getStatsOther function, you will see how this is calculated. Since the actual text typed in is stored in the database, each time this is typed it is going to be different, so we can't create a query to match this. We get round the problem by counting all the other options and determine what is left, which must be _OTHER_. There is also the assumption that the question is mandatory so at least one of the options is always selected.
Firstly on line 723, you can see how it is determining the total by counting the rows in your answer table.
$total = count($rows);
Then on line 739, you can see where it loops through the options in the question. The query looks for each option, for example "News Bulletin", and counts how many rows in the answer table contain this value. We then add this to the count variable.
Then after all the options, we take the total and subtract the count to get the value of the _OTHER_ option.
$num = $total-$count;
So based on your screenshot, I would have expected the _OTHER_ total would be:
215 - 118 - 31 - 55 - 11 = 0
Which is different again to what you are getting and what you are expecting.
The first thing to determine is why are you getting a total of 215 instead of 226? Is there actually 226 records in your answer table? Then we need to determine why it shows -19 for the total. I'm wondering if blank options are being counted multiple times and being deducted from the total.
You could possibly debug by adding a few lines to the function:
echo "<br>DEBUG: query=".$query;
//add just before
You should then see the query outputted by the software, which you can test on your mySQL database using phpMyAdmin and see if you are getting the result you expected.
I'm wondering if the query needs something to check to make sure that the response is not blank, maybe something like:
$query->where( $db->quote(JString::trim($db->escape( $qn->$tempoption, true ))) );
Follow us on twitter http://twitter.com/tamlynsoftware