{"id":184,"date":"2020-04-27T23:33:53","date_gmt":"2020-04-27T23:33:53","guid":{"rendered":"https:\/\/dxhelpdev.wpengine.com\/?post_type=epkb_post_type_1&#038;p=184"},"modified":"2020-08-19T23:24:04","modified_gmt":"2020-08-19T23:24:04","slug":"custom-calculations","status":"publish","type":"epkb_post_type_1","link":"https:\/\/dxhelp.scytec.com\/?epkb_post_type_1=custom-calculations","title":{"rendered":"Custom Calculations"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Overview<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In DataXchange there are only two places where calculations can occur and be used for non-comparison functionality: parameters for variables, and custom variable targets.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The calculations can occur only when the four math operators are included in an expression: PLUS, MINUS, MULTIPLY and DIVIDE.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Examples<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">These examples show math operations used with custom variables.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>This sets the variable &#8220;some_custom_variable&#8221; to the same as the current value for &#8220;[MTC.xcom]&#8221;.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><code>[PCSDB.send_save_custom_variable_value] {some_custom_variable} &nbsp;== [MTC.xcom]<\/code><\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>This will set the value of the variable &#8220;x_following_error&#8221; to the number \u201832\u2019.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><code>[PCSDB.send_save_custom_variable_value] {x_following_error} &nbsp;== 32<\/code><\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>In the following case the value for &#8220;x_following_error&#8221; will be the number \u20183\u2019.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><code>[PCSDB.send_save_custom_variable_value] {x_following_error} &nbsp;== (5 MINUS 2)<\/code><\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>Here the value for &#8220;x_following_error&#8221; will be \u201810\u2019.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><code>[PCSDB.send_save_custom_variable_value] {x_following_error} &nbsp;== (5 MULTIPLY 2)<\/code><\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\"><li>This sets the value for &#8220;x_following_error&#8221; to \u2018(5 &gt; 2)\u2019.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><code>[PCSDB.send_save_custom_variable_value] {x_following_error} &nbsp;== (5 &gt; 2)<\/code><\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\"><li>In this example the value for &#8220;x_following_error&#8221; will be \u2018(5 &lt; 2)\u2019.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><code>[PCSDB.send_save_custom_variable_value] {x_following_error} &nbsp;== (5 &lt; 2)<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>NOTE:<\/em>&nbsp;This functionality &nbsp;will also work for [PCSDB.send_custom_variable_indicator], but the value for the indicator must be a color.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">IMPORTANT: The previous syntax for this was using a single \u2018=\u2019 sign. It has been changed to double \u2018==\u2019 equal signs so it is not confused with the single \u2018=\u2019 equal sign used for comparisons.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview In DataXchange there are only two places where calculations can occur and be used for non-comparison functionality: parameters for variables, and custom variable targets. The calculations can occur only when the four math operators are included in an expression: PLUS, MINUS, MULTIPLY and DIVIDE. Examples These examples show math operations used with custom variables. [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"epkb_post_type_1_category":[103,36],"epkb_post_type_1_tag":[],"class_list":["post-184","epkb_post_type_1","type-epkb_post_type_1","status-publish","hentry","epkb_post_type_1_category-building-expressions","epkb_post_type_1_category-tutorials-expressions"],"_links":{"self":[{"href":"https:\/\/dxhelp.scytec.com\/index.php?rest_route=\/wp\/v2\/epkb_post_type_1\/184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dxhelp.scytec.com\/index.php?rest_route=\/wp\/v2\/epkb_post_type_1"}],"about":[{"href":"https:\/\/dxhelp.scytec.com\/index.php?rest_route=\/wp\/v2\/types\/epkb_post_type_1"}],"author":[{"embeddable":true,"href":"https:\/\/dxhelp.scytec.com\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/dxhelp.scytec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=184"}],"version-history":[{"count":0,"href":"https:\/\/dxhelp.scytec.com\/index.php?rest_route=\/wp\/v2\/epkb_post_type_1\/184\/revisions"}],"wp:attachment":[{"href":"https:\/\/dxhelp.scytec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=184"}],"wp:term":[{"taxonomy":"epkb_post_type_1_category","embeddable":true,"href":"https:\/\/dxhelp.scytec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fepkb_post_type_1_category&post=184"},{"taxonomy":"epkb_post_type_1_tag","embeddable":true,"href":"https:\/\/dxhelp.scytec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fepkb_post_type_1_tag&post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}