User Tools

Site Tools


transformations:rule

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
transformations:rule [2015/04/10 14:47] elenaptransformations:rule [2019/05/30 06:58] dmitry
Line 1: Line 1:
 ===== Rule ===== ===== Rule =====
  
-This transformation calculates new or replaces column by using nested IF...THEN...ELSE conditions. While the same result can be achieved using an expression with nested [[syntax:functions:if]] functions, the use of Rule transformation is recommended for clarity and readability.+This action calculates new or replaces existing column by using one or several ordered IF...THEN...ELSE conditions. The conditions are checked one by one until a satisfying condition is found. When a satisfying condition is found, the result is calculated and all other conditions are ignored. When no satisfying condition is found, the default calculation is applied.
  
-Rule transformation is somewhat similar to //switch// or //case// statements in popular programming languages.+The order of conditions is significant as conditions are checked starting from the first (top). Therefore conditions that come first have priority over conditions that come after them. 
 + 
 + 
 +While the same result can be achieved using an expression with nested [[syntax:functions:if]] functions, the use of Rule action is recommended for clarity, readability, and the ease of rearranging the order.
  
 EXAMPLE EXAMPLE
Line 30: Line 33:
 | Switzerland  |  53716  |  48414  |  9.87%  |  HIGH  | | Switzerland  |  53716  |  48414  |  9.87%  |  HIGH  |
 | Canada  |  45896  |  37469  |  18.36%  |  LOW  | | Canada  |  45896  |  37469  |  18.36%  |  LOW  |
 +
 +
 +** See also**
 +
 + * [[https://community.easymorph.com/t/place-stronger-conditions-first-in-the-rule-action/1113|Community: Place stronger conditions first in the Rule action]]
transformations/rule.txt · Last modified: 2021/07/19 02:30 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki