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