Function: minus(min(numbers("xxy") if numbers('ryy') > minus(numbers('ryy'), numbers("xxy")) else sum(minus(numbers('ryy'), numbers("xxy")), numbers('ryy')), sum(minus(numbers('ryy'), numbers("xxy")), numbers('ryy'))), sum(minus(numbers('ryy'), numbers("xxy")), numbers('ryy')) if minus(numbers('ryy'), numbers("xxy")) > numbers("xxy") else numbers('ryy'))