{"id":4596,"date":"2016-07-19T00:26:53","date_gmt":"2016-07-18T16:26:53","guid":{"rendered":"http:\/\/localhost\/help\/?page_id=4596"},"modified":"2024-06-21T11:59:18","modified_gmt":"2024-06-21T03:59:18","slug":"single-point-fetch-vs-range-fetch","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/primers\/transforms\/single-point-fetch-vs-range-fetch\/","title":{"rendered":"Single Point Fetch vs Range Fetch"},"content":{"rendered":"<div id=\"toc_container\" class=\"toc_white no_bullets\">\n<p class=\"toc_title\">Contents<\/p>\n<ul class=\"toc_list\">\n<li><a href=\"#Range_Fetch\">Range Fetch<\/a>\n<ul>\n<li><a href=\"#Ranged_Raw\">Ranged Raw<\/a><\/li>\n<li><a href=\"#Ranged_Last_Known_Value\">Ranged Last Known Value<\/a><\/li>\n<li><a href=\"#Ranged_Linear_Interpolate\">Ranged Linear Interpolate<\/a><\/li>\n<li><a href=\"#Ranged_Average\">Ranged Average<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#Single_Point_Fetch\">Single Point Fetch<\/a>\n<ul>\n<li><a href=\"#Single_Point_Raw\">Single Point Raw<\/a><\/li>\n<li><a href=\"#Single_Point_Raw_No_Value\">Single Point Raw - No Value<\/a><\/li>\n<li><a href=\"#Single_Point_Last_Known_Value\">Single Point Last Known Value<\/a><\/li>\n<li><a href=\"#Single_Point_Last_Known_Value_No_Value\">Single Point Last Known Value - No Value<\/a><\/li>\n<li><a href=\"#Single_Point_Linear_Interpolate\">Single Point Linear Interpolate<\/a><\/li>\n<li><a href=\"#Single_Point_Linear_Interpolate_No_Value\">Single Point Linear Interpolate - No Value<\/a><\/li>\n<li><a href=\"#Single_Point_Average\">Single Point Average<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<p class=\"intro-text\">When getting data from IFS OI<a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/primers\/server-system-overview\/\">\u00a0Server<\/a>, depending on how you set the request interval, you can get IFS OI Server to return different numbers of results. These two different methods are known as <em><strong>Range Fetches<\/strong><\/em> and <em><strong>Single Point<\/strong><\/em> (<em>or Spot<\/em>) <em><strong>Fetches<\/strong><\/em>.<\/p>\n<p class=\"left-bar\">Related: <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/primers\/transforms\/\">Data Transformations and Sample Methods<\/a><\/p>\n<div class=\"best-prac\">\n<p class=\"best-prac-desc\"><i class=\"fa fa-download fa-2x fa-pull-left\"><\/i> \u00a0\u00a0<a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/printables\/P2%20Server%20Sampling%20Cheat%20Sheet.pdf\" data-slimstat-clicked=\"false\" data-slimstat-type=\"1\" data-slimstat-tracking=\"true\" data-slimstat-callback=\"true\" data-slimstat-async=\"false\">Download the cheat sheet!<\/a><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<h2 id=\"Range_Fetch\" class=\"page-subheading\">Range Fetch<\/h2>\n<p class=\"intro-text\">A Range Fetch is one where the start time and end time are set to different values, and a stream of data is returned. An example of this may be setting the start time as 1-1-2015 and the end time as 2-1-2015. Range fetches like this will return 1 or more data points, depending on the sample interval and the presence of data in the source system.<\/p>\n<p class=\"intro-text\">The IFS OI<a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/\">\u00a0Explorer<\/a> trend is an example of where a range fetch is used, as we want a continuous stream of data being returned for the time period chosen. In\u00a0the following example, the source system has data for the specified time period. If there is no data for that period, no data points would be returned.<\/p>\n<p class=\"left-bar\">Related: <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/trends\/creating-a-trend\/\">Creating a Trend<\/a><\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2021\/03\/Server-trend.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-47689\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2021\/03\/Server-trend-600x349.png\" alt=\"\" width=\"1000\" height=\"582\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2021\/03\/Server-trend-600x349.png 600w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2021\/03\/Server-trend-768x447.png 768w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2021\/03\/Server-trend-150x87.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2021\/03\/Server-trend-48x28.png 48w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2021\/03\/Server-trend.png 1076w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p class=\"intro-text\">For <strong>Average, Last Known Value<\/strong>, and<strong> Linear Interpolate<\/strong>\u00a0sample methods, the first result returned should be at the <em>Start Time<\/em>, with subsequent values at each sample interval <em>forwards<\/em> from that time, up to and including the <em>End Time<\/em>. If the duration between the Start Time and End Time is not a whole number of intervals, then no value is returned at the End Time.<\/p>\n<p class=\"intro-text\">For the <strong>Raw<\/strong> sample method, the sample interval has no effect.<\/p>\n<h3 id=\"Ranged_Raw\">Ranged Raw<\/h3>\n<p class=\"intro-text\">Ranged Raw sampling returns all values, and their timestamps, that occur between and including the Start Time and End Time, if they exist. In this scenario, a\u00a0request is made for the ranged raw values between a Start Time of 2:00:00 AM and an End Time of 8:00:00 AM.<\/p>\n<p class=\"intro-text\"><strong>Parameters<\/strong>:\u00a0Start Time = 2:00:00 AM, End Time = 8:00:00 AM<br \/>\n<strong>Return values<\/strong>:<\/p>\n<p class=\"intro-text\" style=\"padding-left: 30px;\">Value = 0.5, Timestamp = 2:00:00 AM<br \/>\nValue = 4, Timestamp = 3:00:00 AM<br \/>\nValue = 3.5, Timestamp = 5:00:00 AM<br \/>\nValue = 4, Timestamp = 6:00:00 AM<br \/>\nNo value is returned for the End Time, as none exists.<\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangeraw.png\" rel=\"attachment wp-att-11754 lightbox-1\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11754\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangeraw.png\" alt=\"rangeraw\" width=\"466\" height=\"333\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangeraw.png 466w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangeraw-150x107.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangeraw-24x17.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangeraw-36x26.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangeraw-48x34.png 48w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/a><\/p>\n<h3 id=\"Ranged_Last_Known_Value\">Ranged Last Known Value<\/h3>\n<p class=\"intro-text\">This method returns a series of values determined via the Last Known Value method, spaced regularly between the start and end time according to the Interval parameter.<\/p>\n<p class=\"intro-text\">As with Single Point Last Known Value, the returned timestamps are based on the request time (in this case the request \/ interval times), and not the raw timestamp of the underlying data.<\/p>\n<p class=\"intro-text\">A ranged last known value sampling is requested with a Start Time of 2:00:00 AM, an End Time of 8:00:00 AM, and an Interval of 9000 seconds (2.5 hours).<\/p>\n<ul class=\"intro-text\">\n<li>The value 0.5 exists at 2:00:00 AM, so this value is returned with a timestamp of 2:00:00 AM.<\/li>\n<li>The next interval is at 4:30:00 AM, and because no value exists here, the last occurring value of 4 is extrapolated to this point and returned with the 4:30:00 AM timestamp.<\/li>\n<li>The same process is applied for the 7:00:00 AM interval, where the value 4 is extrapolated and returned with the timestamp of 7:00:00 AM.<\/li>\n<li>The next interval exceeds the parameter of our end time, so no value is returned here. End Time values are only returned if the End Time is an integer multiple of intervals after the Start Time, that is, where the Interval and the End Time line up.<\/li>\n<\/ul>\n<p class=\"intro-text\"><strong>Parameters<\/strong>:\u00a0Start Time = 2:00:00 AM, End Time = 8:00:00 AM, Interval = 9000 seconds<br \/>\n<strong>Return values<\/strong>:<\/p>\n<p class=\"intro-text\" style=\"padding-left: 30px;\">Value = 0.5, Timestamp = 2:00:00 AM<br \/>\nValue = 4, Timestamp = 4:30:00 AM<br \/>\nValue = 4, Timestamp = 7:00:00 AM<\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangelkv.png\" rel=\"attachment wp-att-11755 lightbox-2\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11755\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangelkv.png\" alt=\"rangelkv\" width=\"466\" height=\"340\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangelkv.png 466w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangelkv-150x109.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangelkv-24x18.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangelkv-36x26.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangelkv-48x35.png 48w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/a><\/p>\n<h3 id=\"Ranged_Linear_Interpolate\">Ranged Linear Interpolate<\/h3>\n<p class=\"intro-text\">This method returns a series of values determined via the Linear Interpolate method, spaced regularly according to the Interval parameter, between the Start Time and End Time.<\/p>\n<p class=\"intro-text\">As with Single Point Linear Interpolate, each value is calculated using a gradient between the first value occurring before and the first value occurring after the respective request time \/ interval time, with the return value being the intersect of the gradient with the request time \/ interval time. These values are returned with their respective timestamps, which are based on the request time \/ interval time.<\/p>\n<p class=\"intro-text\">A Ranged Linear Interpolate sampling is requested with a Start Time of 2:00:00 AM, an End Time of 8:00:00 AM, with an Interval of 7200 seconds (2 hours).<\/p>\n<ul class=\"intro-text\">\n<li>Data at the Start Time interval does not exist, so the linear interpolate is calculated between the last occurring value before the interval and the first occurring value after the interval, which are 3 and 2 respectively.<\/li>\n<li>The linear interpolate at 4:00:00 AM is calculated using the raw values at 3:00:00 AM and 5:00:00 AM, which are 2 and 3.5 respectively.<\/li>\n<li>The linear interpolate at 6:00:00 AM is calculated using the raw values at 5:00:00 AM and 10:00:00 AM, which are 3.5 and 1.75 respectively.<\/li>\n<li>The linear interpolate at 8:00:00 AM is on the end time, so a value should be returned here. It is also calculated using the raw values at 5:00:00 AM and 10:00:00 AM, which are 3.5 and 1.75 respectively.<\/li>\n<\/ul>\n<p class=\"intro-text\">Thus the parameters and return values are as follows:<\/p>\n<p class=\"intro-text\"><strong>Parameters<\/strong>:\u00a0Start Time = 2:00:00 AM, End Time = 8:00:00 AM, Interval = 7200 seconds<br \/>\n<strong>Return values<\/strong>:<\/p>\n<p class=\"intro-text\" style=\"padding-left: 30px;\">Value = 2.5, Timestamp = 2:00:00 AM<br \/>\nValue = 2.75, Timestamp = 4:00:00 AM<br \/>\nValue = 3.2, Timestamp = 6:00:00 AM<br \/>\nValue = 2.5, Timestamp = 8:00:00 AM<\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangeLI.png\" rel=\"attachment wp-att-11756 lightbox-3\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11756\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangeLI.png\" alt=\"rangeLI\" width=\"466\" height=\"340\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangeLI.png 466w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangeLI-150x109.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangeLI-24x18.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangeLI-36x26.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangeLI-48x35.png 48w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/a><\/p>\n<h3 id=\"Ranged_Average\">Ranged Average<\/h3>\n<p class=\"intro-text\">This method returns a series of values determined via the Average method, spaced regularly between the Start Time and End Time according to the Interval parameter.<\/p>\n<p class=\"intro-text\">As with single point average, each value calculated from the time weighted average of raw data, and the returned timestamps are based on the request\/interval time. The Interval parameter represents both the spacing of data, and the duration over which each average is calculated.<\/p>\n<p class=\"intro-text\">It is important to note that each time-weighted average represents the period <em>before<\/em> the timestamp; thus the first return value of a ranged average fetch actually represents data before the start time.<\/p>\n<p class=\"intro-text\">In the case of the example below, the integral (area) is calculated as follows:<\/p>\n<ul class=\"intro-text\">\n<li>First interval (from the Start Time, back one Interval)\n<ul>\n<li>Segment 1: area = 3 * 3600 seconds<\/li>\n<li>Segment 2: area = 0.5 * 3600 seconds<\/li>\n<li>Time weighted average = (10800 + 1800) \/ (3600 + 3600) = 1.75<\/li>\n<\/ul>\n<\/li>\n<li>Second interval\n<ul>\n<li>Segment 1: area = 4 * 7200 seconds<\/li>\n<li>Time Weighted Average = (28800) \/ (7200) = 4<\/li>\n<\/ul>\n<\/li>\n<li>Third interval\n<ul>\n<li>Segment 1: area = 3.5 * 3600 seconds<\/li>\n<li>Segment 2: area = 4 * 3600 seconds<\/li>\n<li>Time weighted average = (12600 + 14400) \/ (3600 + 3600) = 3.75<\/li>\n<\/ul>\n<\/li>\n<li>Fourth interval (on the End Time)\n<ul>\n<li>Segment 1: area = 4 (extrapolated from the datum at 6:00:00AM) * 7200 seconds<\/li>\n<li>Time Weighted Average = (28800) \/ (7200) = 4<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p class=\"intro-text\">Thus the parameters and return values are as follows:<\/p>\n<p class=\"intro-text\"><strong>Parameters<\/strong>:\u00a0Start Time = 3:00:00 AM, End Time = 9:00:00 AM, Interval = 7200 seconds<br \/>\n<strong>Return values<\/strong>:<\/p>\n<p class=\"intro-text\" style=\"padding-left: 30px;\">Response Value = 1.75, Timestamp = 3:00:00 AM<br \/>\nResponse Value = 4, Timestamp = 5:00:00 AM<br \/>\nResponse Value = 3.75, Timestamp = 7:00:00 AM<br \/>\nResponse Value = 4, Timestamp = 9:00:00 AM<\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangedavg.png\" rel=\"attachment wp-att-11757 lightbox-4\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11757\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangedavg.png\" alt=\"rangedavg\" width=\"466\" height=\"368\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangedavg.png 466w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangedavg-150x118.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangedavg-24x19.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangedavg-36x28.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/rangedavg-48x38.png 48w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/a><\/p>\n<hr \/>\n<h2 id=\"Single_Point_Fetch\" class=\"page-subheading\">Single Point Fetch<\/h2>\n<p class=\"intro-text\">With a Single Point Fetch, the start and end time are set to the same date\/time (such as 2-1-2015) and only 1 point of data is returned. Single point fetches are most commonly used with the <em>Last Known Value<\/em> sample method.<\/p>\n<p class=\"intro-text\">In the background, a single point fetch will use the provided end date and automatically subtract the sample interval from it, to arrive at the start date. This saves the external application from having to calculate this itself. Other sample methods, such as average, will continue to function correctly. You can consider a single point fetch as being a smart helper when you only want a single value returned.<\/p>\n<p class=\"intro-text\">A single point fetch is typically used to display a single value on an Explorer page, for example on a schematic page. We only have the ability to display one number on the page, so there is no point in returning more data than we can show.\u00a0In\u00a0the following example, the source system has data for the specified time period. If there is no data for that period, no data points would be returned.<\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2021\/03\/Server-Primer-Transforms-sshematic-pg-2.png\" rel=\"lightbox-5\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-47706 size-medium\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2021\/03\/Server-Primer-Transforms-sshematic-pg-2-600x540.png\" alt=\"\" width=\"600\" height=\"540\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2021\/03\/Server-Primer-Transforms-sshematic-pg-2-600x540.png 600w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2021\/03\/Server-Primer-Transforms-sshematic-pg-2-150x135.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2021\/03\/Server-Primer-Transforms-sshematic-pg-2-48x43.png 48w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2021\/03\/Server-Primer-Transforms-sshematic-pg-2.png 724w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3 id=\"Single_Point_Raw\">Single Point Raw<\/h3>\n<p class=\"intro-text\">Single Point Raw sampling returns the last occurring value on or before the requested time, with the timestamp of the requested value.<\/p>\n<p class=\"intro-text\">If a value exists for the requested time, that value will be returned along with the timestamp of the value, as demonstrated in the following example.<\/p>\n<p class=\"intro-text\"><strong>Parameters<\/strong>:\u00a0Request Time = 5:00:00 AM<br \/>\n<strong>Return values<\/strong>:\u00a0Response Value = 3.5, Timestamp = 5:00:00 AM<\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1.png\" rel=\"attachment wp-att-11734 lightbox-6\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11734\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1.png\" alt=\"spraw1\" width=\"466\" height=\"333\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1.png 466w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1-150x107.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1-24x17.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1-36x26.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1-48x34.png 48w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h3 id=\"Single_Point_Raw_No_Value\">Single Point Raw - No Value<\/h3>\n<p class=\"intro-text\">If no value exists for a requested time, then the last value <em>before<\/em> the requested time is returned, as demonstrated in the following example.<\/p>\n<p class=\"intro-text\"><strong>Parameters<\/strong>:\u00a0Request Time = 7:30:00 AM<br \/>\n<strong>Return values<\/strong>:\u00a0Response Value = 2, Timestamp = 7:00:00 AM<\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw2.png\" rel=\"attachment wp-att-11735 lightbox-7\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11735\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw2.png\" alt=\"spraw2\" width=\"466\" height=\"333\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw2.png 466w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw2-150x107.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw2-24x17.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw2-36x26.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw2-48x34.png 48w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h3 id=\"Single_Point_Last_Known_Value\">Single Point Last Known Value<\/h3>\n<p class=\"intro-text\">Single Point Last Known Value sampling returns the last known value with the timestamp of the request (not the timestamp of the value).<\/p>\n<p class=\"intro-text\">This works much the same as Single Point Raw; however, in cases where no value exists for a requested time, the timestamp of the request itself is returned, instead of the timestamp of the requested source data.<\/p>\n<p class=\"intro-text\">If a value exists for the requested time, that value will be returned along with the timestamp of the request.\u00a0For example:<\/p>\n<p class=\"intro-text\"><strong>Parameters<\/strong>:\u00a0Request Time = 5:00:00 AM<br \/>\n<strong>Return values<\/strong>:\u00a0Response Value = 3.5, Timestamp = 5:00:00 AM<\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1.png\" rel=\"attachment wp-att-11734 lightbox-6\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11734\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1.png\" alt=\"spraw1\" width=\"466\" height=\"333\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1.png 466w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1-150x107.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1-24x17.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1-36x26.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1-48x34.png 48w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/a><\/p>\n<h3 id=\"Single_Point_Last_Known_Value_No_Value\">Single Point Last Known Value - No Value<\/h3>\n<p class=\"intro-text\">If no value exists for a requested time, then the last value <em>before<\/em> the requested time is returned, along with the timestamp of the <em>request<\/em> (as opposed to the timestamp of the source data).\u00a0For example:<\/p>\n<p class=\"intro-text\"><strong>Parameters<\/strong>:\u00a0Request Time = 7:30:00 AM<br \/>\n<strong>Return values<\/strong>:\u00a0Response Value = 2, Timestamp = 7:30:00 AM<\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw2.png\" rel=\"attachment wp-att-11735 lightbox-7\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11735\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw2.png\" alt=\"spraw2\" width=\"466\" height=\"333\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw2.png 466w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw2-150x107.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw2-24x17.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw2-36x26.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw2-48x34.png 48w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h3 id=\"Single_Point_Linear_Interpolate\">Single Point Linear Interpolate<\/h3>\n<p class=\"intro-text\">Single Point Linear Interpolation calculates the intersection between the requested time and the interpolation of adjacent raw values.<\/p>\n<p class=\"intro-text\">If a value exists for the request time, no interpolation is required and that value will be returned along with the timestamp of the request.\u00a0For example:<\/p>\n<p class=\"intro-text\"><strong>Parameters<\/strong>:\u00a0Request Time = 5:00:00 AM<br \/>\n<strong>Return values<\/strong>:\u00a0Response Value = 3.5, Timestamp = 5:00:00 AM<\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1.png\" rel=\"attachment wp-att-11734 lightbox-6\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11734\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1.png\" alt=\"spraw1\" width=\"466\" height=\"333\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1.png 466w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1-150x107.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1-24x17.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1-36x26.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/spraw1-48x34.png 48w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h3 id=\"Single_Point_Linear_Interpolate_No_Value\">Single Point Linear Interpolate - No Value<\/h3>\n<p class=\"intro-text\">If no value exists at the request time, a gradient between the first value occurring before and the first value occurring after the requested time is calculated, and the value found at the intersect of this line and the time requested is returned.<\/p>\n<p class=\"intro-text\">In the case of the example below, a line is drawn between the previous value of 4 at 6:00:00 AM, and the next value of 1.5 at 9:00:00 AM. The result is calculated by the intersection of the request time as follows:<\/p>\n<p class=\"intro-text\"><strong>Parameters<\/strong>:\u00a0Request Time = 8:00:00 AM<br \/>\n<strong>Return values<\/strong>:\u00a0Response Value = 2.333, Timestamp = 8:00:00 AM<\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/li2.png\" rel=\"attachment wp-att-11744 lightbox-11\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11744\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/li2.png\" alt=\"li2\" width=\"466\" height=\"333\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/li2.png 466w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/li2-150x107.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/li2-24x17.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/li2-36x26.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/li2-48x34.png 48w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/a><\/p>\n<h3 id=\"Single_Point_Average\">Single Point Average<\/h3>\n<p class=\"intro-text\">Single Point Average sampling calculates the time-weighted average for a particular point in time over the requested interval.<\/p>\n<p class=\"intro-text\">The idea behind time-weighting is that continuous-type data may have irregularly spaced data due to compression by historians. The absence of a raw datum does not mean that that value is less significant; instead it is assumed that the last value extrapolates forwards.<\/p>\n<p class=\"intro-text\">Mathematically, the time-weighted average is determined by calculating the integral of the data (the area under the curve), divided by the duration.<\/p>\n<p class=\"intro-text\">In the case of the example below, the integral (area) is calculated as follows:<\/p>\n<p class=\"intro-text\" style=\"padding-left: 30px;\">Segment 1: area = 4 (extrapolated from the datum at 3:00:00AM) * 3600 seconds<br \/>\nSegment 2: area = 3.5 * 3600 seconds<br \/>\nSegment 3: area = 4 * 7200 seconds<\/p>\n<p class=\"intro-text\">Time Weighted Average = (14400 + 12600 + 28800) \/ (3600 + 3600 + 7200) = 3.875<\/p>\n<p class=\"intro-text\"><strong>Parameters<\/strong>:\u00a0Request Time = 8:00:00 AM, Interval = 14400 seconds<br \/>\n<strong>Return values<\/strong>:\u00a0Response Value = 3.875, Timestamp = 8:00:00 AM<\/p>\n<p><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/avg.png\" rel=\"attachment wp-att-11748 lightbox-12\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11748\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/avg.png\" alt=\"avg\" width=\"466\" height=\"333\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/avg.png 466w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/avg-150x107.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/avg-24x17.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/avg-36x26.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/07\/avg-48x34.png 48w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When getting data from IFS OI Server, depending on how you set the request interval, you can get IFS OI Server to return different numbers of results. These two different methods are known as Range Fetches and Single Point (or Spot) Fetches. This article explains the differences between them.<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/primers\/transforms\/single-point-fetch-vs-range-fetch\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":4601,"parent":3672,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[3],"tags":[291,297,288,210],"class_list":["post-4596","page","type-page","status-publish","has-post-thumbnail","hentry","category-primer","tag-data-fetch","tag-range-fetch","tag-request-interval","tag-single-point-data-fetch","Product-srv"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/4596","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=4596"}],"version-history":[{"count":6,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/4596\/revisions"}],"predecessor-version":[{"id":67462,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/4596\/revisions\/67462"}],"up":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/3672"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media\/4601"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=4596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=4596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=4596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}