I usually create a custom macro method, that way inside of my transformation I can reference it throught a simple call and use it over and over. I would recommend caching it though, because each time the macro is hit, you don't want to hit the database/server for each.