{"id":9682,"date":"2016-02-22T11:32:38","date_gmt":"2016-02-22T03:32:38","guid":{"rendered":"http:\/\/localhost\/help\/?page_id=9682"},"modified":"2024-08-15T10:31:31","modified_gmt":"2024-08-15T02:31:31","slug":"samplefilter","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/samplefilter\/","title":{"rendered":"SampleFilter()"},"content":{"rendered":"\n<h2><span id=\"Format\">Format<\/span><\/h2>\n<p class=\"intro-text\"><strong>SampleFilter(TimeString,Condition)<\/strong><\/p>\n<h2><span id=\"Returns\">Returns<\/span><\/h2>\n<p class=\"intro-text\">Returns samples in the first argument\u00a0only\u00a0where the condition\u00a0evaluates to true.<\/p>\n<h2><span id=\"Parameters\">Inputs<\/span><\/h2>\n<p class=\"intro-text\"><strong>TimeString<\/strong>: The time expressed as a string.<br \/>\n Behaviour: Required<br \/>\n Dimension:\u00a0Collection, SingleValue<br \/>\n Valid\u00a0data types:\u00a0Null, Boolean, DateTime, Decimal, Integer, String, Duration<\/p>\n<p class=\"intro-text\"><strong>Condition<\/strong>: The condition being evaluated.<br \/>\n Behaviour:\u00a0Required<br \/>\n Dimension: Collection, SingleValue<br \/>\n Valid data types: Null, Boolean, DateTime, Decimal, Integer, String, Duration<\/p>\n<p class=\"left-bar\">Note: You can use the <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/time\/\" data-slimstat-clicked=\"false\" data-slimstat-type=\"2\" data-slimstat-tracking=\"false\" data-slimstat-callback=\"false\" data-slimstat-async=\"false\">Time<\/a>() function to use a valid DateTime argument.<\/p>\n<p class=\"left-bar-yellow\">It is possible to retrieve very large volumes of data through indiscriminate use of this function. Retrieving large amounts of Historian data across a slow network can affect system performance for all users of the system<\/p>\n<h2>Examples<\/h2>\n<p class=\"intro-text\">This is most commonly used with historical functions such as <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/sum_sampled\/\">Sum_Sampled<\/a>(), \u00a0<a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/average_sampled\/\">Average_Sampled<\/a>(), and so on. For example, the average of all values of X when Y is greater than 10, since midnight:<\/p>\n<p class=\"intro-text\"><code>Average_Sampled(SampleFilter(X, Y &gt; 10), Midnight(Time()))<\/code><\/p>\n<p class=\"intro-text\">\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use SampleFilter() to only get samples from an expression where a condition is true.<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/samplefilter\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":9710,"parent":3650,"menu_order":184,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[9],"tags":[100,371],"class_list":["post-9682","page","type-page","status-publish","has-post-thumbnail","hentry","category-tech-ref","tag-calculations","tag-samplefilter","Product-srv"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/9682","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=9682"}],"version-history":[{"count":1,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/9682\/revisions"}],"predecessor-version":[{"id":46240,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/9682\/revisions\/46240"}],"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\/9710"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=9682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=9682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=9682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}