{"id":64911,"date":"2024-01-17T13:50:11","date_gmt":"2024-01-17T05:50:11","guid":{"rendered":"https:\/\/oihelp.corporate.ifs.com\/help\/?page_id=64911"},"modified":"2024-08-15T10:31:32","modified_gmt":"2024-08-15T02:31:32","slug":"tablelookup","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/tablelookup\/","title":{"rendered":"TableLookup()"},"content":{"rendered":"\n<h2>Format<\/h2>\n<p class=\"intro-text\">TableLookup(Dataset ,SearchColumn ,ReturnValueColumn ,LookupValue [,InterpolationMethod])<\/p>\n<h2>Returns<\/h2>\n<p class=\"intro-text\">The lookup result, which will be either a single value or a tag, depending on the lookup value. If any lookup value is outside the range of the dataset, the corresponding result will be an error value.\u00a0<\/p>\n<p class=\"intro-text\">The function enables linear interpolation between two values to find and calculate a result, and could replace, for example, tank strapping tables.\u00a0The volume of liquid in a tank can be calculated from the measured height of the liquid in the tank, with linear interpolation being applied when the height is between two mapped height values.<\/p>\n<h2>Inputs<\/h2>\n<p class=\"intro-text\"><b>Dataset:\u00a0<\/b>The name of the dataset in Server Management that the lookup is coming from. If it doesn't have at least two rows, or it has some duplicate values in the search column, an error is returned.<br \/>\nBehaviour: Required<br \/>\nDimensions: Matrix<br \/>\nValid data types: Null, Boolean, DateTime, Decimal, Integer, String, Duration<\/p>\n<p class=\"intro-text\"><b>SearchColumn:\u00a0<\/b>The index or name of the column to search for the lookup value. This column should have numeric data, otherwise an error is returned.<br \/>\nBehaviour: Required<br \/>\nDimensions: SingleValue<br \/>\nValid data types: Integer, String<\/p>\n<p class=\"intro-text\"><b>ReturnValueColumn:\u00a0<\/b>The index or name of the column to use for the return value. This column should have numeric data, otherwise an error is returned.<br \/>\nBehaviour: Required<br \/>\nDimensions: SingleValue<br \/>\nValid data types: Integer, String<\/p>\n<p class=\"intro-text\"><b>LookupValue:\u00a0<\/b>The value to look up. This can be a single value or multiple values.<br \/>\nBehaviour: Required<br \/>\nDimensions: Collection, SingleValue<br \/>\nValid data types: Decimal, Integer<\/p>\n<p class=\"intro-text\"><b>InterpolationMethod:\u00a0<\/b>How to find a value when the search column doesn't match exactly. Options are Floor (value immediately below), Ceiling (value immediately above), Round (value below or above, switching half way between) or Linear (use linear interpolation). Defaults to Floor.<br \/>\nBehaviour: Optional<br \/>\nDimensions: SingleValue<br \/>\nValid data types: String<\/p>\n<h2>Points to Note<\/h2>\n<ul class=\"intro-text\">\n<li>Conversion of floating point data could result in some unexpected behaviour.<\/li>\n<li>Use high precision data types where possible.<\/li>\n<\/ul>\n<h2>Examples<\/h2>\n<p class=\"intro-text\">Expression: <span class=\"code-fragment\">TableLookup({TankStrappingData, TankName=\"Tank 1\"}, 0, 1, 3)<\/span><br \/>\nResult: Single value of 50000, which is the matching value in the TankStrappingData dataset for the lookup value 3, using the default Floor interpolation method.<\/p>\n<p class=\"intro-text\">Expression: <span class=\"code-fragment\">TableLookup({TankStrappingData, TankName=\"Tank 2\"}, 0, 1, {Tag}, \"Linear\")<\/span><br \/>\nResult: Tag value of {TransformedTag}, in which each value is the matching value in the TankStrappingData dataset, using Linear interpolation.<\/p>\n<h2>Release History<\/h2>\n<ul class=\"intro-text\">\n<li>TableLookup() 4.13.2\n<ul class=\"intro-text\">\n<li>Initial version<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>TableLookup() returns the result of a table lookup, which will be either a single value or a tag, depending on the lookup value. If any lookup value is outside the range of the dataset, the corresponding result will be an error value. It enables linear interpolation between two values to find and calculate a result.<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/tablelookup\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":36105,"parent":3650,"menu_order":211,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[9],"tags":[1155,1132,168],"class_list":["post-64911","page","type-page","status-publish","has-post-thumbnail","hentry","category-tech-ref","tag-strapping","tag-tablelookup","tag-tank","Version-4-13-2","Product-srv"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/64911","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=64911"}],"version-history":[{"count":6,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/64911\/revisions"}],"predecessor-version":[{"id":64985,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/64911\/revisions\/64985"}],"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\/36105"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=64911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=64911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=64911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}