Rewrite Calc using (MATCH ...) function