Here is an answer I gave ages ago on stackoverflow which deals with exactly that issue.
http://stackoverflow.com/a/9531624/485589https://stackoverflow.com/a/9531624/485589
The gist of it is that when you add a column with a computed value, you also need to supply the SQL filter syntax for it.
There are several ways that can be done, all outlined in the post linked to above.