{"id":16326,"date":"2016-07-01T08:33:55","date_gmt":"2016-07-01T00:33:55","guid":{"rendered":"http:\/\/localhost\/help\/?page_id=16326"},"modified":"2024-08-15T10:31:30","modified_gmt":"2024-08-15T02:31:30","slug":"replaceerror","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/replaceerror\/","title":{"rendered":"ReplaceError()"},"content":{"rendered":"\n<h2><span id=\"Format\">Format<\/span><\/h2>\n<p class=\"intro-text\"><strong>ReplaceError(Arg1)<\/strong><\/p>\n<h2><span id=\"Returns\">Returns<\/span><\/h2>\n<p class=\"intro-text\">Returns the value of <em>Arg1<\/em>, replacing any errors in the collection with the last known value, if possible.<\/p>\n<p class=\"intro-text\">Whenever the function finds an error in the collection, it will first look for the <strong><em>last known value<\/em><\/strong> which is not an error.\u00a0<\/p>\n<ul class=\"intro-text\">\n<li>If the function can find the <strong><em>last known value<\/em><\/strong> which is not an error, then it will replace the error\u00a0with the last known value.<\/li>\n<li>If the function cannot find a last known value, then it will look for the <strong><em>first known value<\/em><\/strong> (in the future) and replace the error\u00a0with that.<\/li>\n<li>If this search fails and a\u00a0non-error value cannot be found in either direction, then it will replace the error\u00a0with the following\u00a0<em><strong>error<\/strong><\/em>:<br \/>\n (<em>\u201cThe source error\u00a0value has been replaced with an error as no other non-error\u00a0replacement value was found.\u201d<\/em>). The original error is retained as an inner exception, to assist with diagnosing issues.<\/li>\n<\/ul>\n<h2>Inputs<\/h2>\n<p class=\"intro-text\"><strong>Arg1<\/strong>:\u00a0The argument being checked for errors and lack of samples or data.<br \/>\n Behaviour: Required<br \/>\n Dimension: Collection<br \/>\n Valid\u00a0data types: Null, Boolean, DateTime, Decimal, Integer, String, Duration, Error<\/p>\n<p class=\"left-bar\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/calculation-syntax\/#Data_Type\">How to format data types<\/a><\/p>\n<p class=\"intro-text\">\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use ReplaceError() to replace errors in a collection with the last known value.<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/replaceerror\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":16354,"parent":3650,"menu_order":171,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[9],"tags":[100,416,417,463],"class_list":["post-16326","page","type-page","status-publish","has-post-thumbnail","hentry","category-tech-ref","tag-calculations","tag-catch","tag-error","tag-replace","Product-srv"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/16326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/comments?post=16326"}],"version-history":[{"count":1,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/16326\/revisions"}],"predecessor-version":[{"id":46236,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/16326\/revisions\/46236"}],"up":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/3650"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media\/16354"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=16326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=16326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=16326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}