Have you tried pushing this down to the database as part of you DDR SQL?
Keep in mind DDR (direct DB requests) bypass the core of the tool, so you don't get most of the feature the tool has.
If you want a calculation you need to do as Joel said: do it in your query (as you are writing a query instead of using the models of your RPD, you can't really expect to not have to model things but then have the tool automating things and letting you add calculated items etc.).
You could create an opaque view on the physical layer and then use this to model in your business model layer very rapidly, but DDR should be temporary measures, not permanent solutions - and opaque views are not much improvement before anyone else says it...