transformations:rule
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
transformations:rule [2019/05/30 06:30] – dmitry | transformations:rule [2021/04/01 18:30] – craigt | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Rule ===== | + | {{ transformations: |
+ | ====== | ||
+ | Category: Transform / Basic\\ | ||
- | 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. | + | \\ |
- | + | =====Description===== | |
- | 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. | + | This action calculates |
+ | 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 later. | ||
While the same result can be achieved using an expression with nested [[syntax: | While the same result can be achieved using an expression with nested [[syntax: | ||
+ | \\ | ||
- | EXAMPLE | ||
- | **Source table:** Average income | + | \\ |
+ | =====Action settings===== | ||
+ | ====Column options==== | ||
+ | ^Setting^Description^ | ||
+ | |Create new column|This option creates a new column with the results of the rule. Enter a name for the new column in the text box at the right.| | ||
+ | |Replace existing|With this option, select the column that will contain the results of the rule, overwriting the existing values.| | ||
+ | \\ | ||
+ | ====Calculated as settings==== | ||
+ | ^Setting^Description^ | ||
+ | |if|An expression that evaluates to either //TRUE// or //FALSE// which determines whether the //then// statement will be processed (i.e., the //then// will run when the //if// expression is TRUE.| | ||
+ | |then|The value inserted into the column when the //if// condition is TRUE. This can be entered as an expression or static value. | ||
+ | You can add more if/then conditions using the //Add more rules// option. | ||
+ | \\ | ||
+ | ====No conditions met options==== | ||
+ | ^Setting^Description^ | ||
+ | |Make empty|If none of the //if// statements evaluate to TRUE, enter an " | ||
+ | |Default to|Options: | ||
+ | |Keep original value|If none of the //if// statements evaluate to TRUE, retain the original value.| | ||
- | ^ Country | + | \\ |
- | | United States | + | =====Examples===== |
- | | Australia | + | |
- | | Switzerland | + | |
- | | Canada | + | |
**Objective: | **Objective: | ||
The spending potential is high if the disposable income is $40,000 or more. | The spending potential is high if the disposable income is $40,000 or more. | ||
- | **Transformation parameters:** | + | **Source table:** Average income and deductions |
- | * Create new column: Spending | + | |
- | | + | ^ Country |
- | | + | | United States |
+ | | Australia | ||
+ | | Switzerland | ||
+ | | Canada | ||
+ | |||
+ | **Action parameters: | ||
+ | >Create new column: Spending | ||
+ | >Calculated as: if ([Disposable income] > 40000), then HIGH. | ||
+ | >If none of the condition above is met: Default to LOW | ||
**Output table:** | **Output table:** | ||
- | ^ Country | + | ^Country |
- | | United States | + | | United States |
- | | Australia | + | | Australia |
- | | Switzerland | + | | Switzerland |
- | | Canada | + | | Canada |
+ | |||
+ | \\ | ||
+ | =====Shortcuts===== | ||
+ | Fast ways to create the action:\\ | ||
+ | *Right-click on a column heading, and select " | ||
+ | *Click the drop-down arrow in a column heading and select " | ||
+ | |||
+ | \\ | ||
+ | =====See also===== | ||
+ | * [[transformations: | ||
+ | * [[transformations: | ||
+ | * [[https:// |
transformations/rule.txt · Last modified: 2021/07/19 02:30 by craigt