You can use a microflow attribute that does exactly what you said: calculate it on the fly. It won't be a column in your database.
Microflow attributes should only be calculated when they are used but I know that there is a 'bug' in Mendix that the attribute also is calculated when for example just retrieving a list of objects in a microflow. That can cost you performance but most times an calculated attribute will help you out, and they're intended to do this kind of calculations.