transformations:addcolumn
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
transformations:addcolumn [2015/01/29 23:02] – created dmitry | transformations:addcolumn [2023/11/24 19:18] – craigt | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Calculate new column(s) ===== | + | {{ transformations: |
+ | ====== CALCULATE NEW COLUMN(S) ====== | ||
+ | Category: Transform / Basic\\ | ||
- | This transformation | + | \\ |
+ | =====Description===== | ||
+ | This action | ||
- | Expression is calculated for every row. Other column values in the same row can be referred by column names in square brackets. It's not possible to refer from one row to another row or to another table. | ||
- | See also | + | \\ |
- | * [[transformations: | + | =====Use cases===== |
+ | *Creating a calculated result from numeric values in two (or more) other columns. | ||
+ | *Concatenating text values from two (or more) other columns. | ||
+ | *Creating a full-column list of the same text or numeric value. | ||
+ | |||
+ | |||
+ | \\ | ||
+ | =====Action settings===== | ||
+ | ^Setting^Description^ | ||
+ | |New column name|Enter the name of the new column.| | ||
+ | |Expression or Value|Options: | ||
+ | |Position|Choose where the new column(s) will appear in the dataset. | ||
+ | |||
+ | \\ | ||
+ | =====Remarks===== | ||
+ | The expression is calculated for every row. Other column values in the same row can be referred to by column names in square brackets. It's not possible to refer to other rows or tables. | ||
+ | |||
+ | Instead of an expression, this action can insert a full column of static text or numeric values.\\ | ||
+ | |||
+ | Subsequent expressions can reference columns previously created within the same //Calculate new column(s)// action. | ||
+ | |||
+ | \\ | ||
+ | =====Examples===== | ||
+ | |||
+ | **Example #1:** Calculate the $ amount of compulsory deductions for each country | ||
+ | |||
+ | **Source table:** Average income and deductions | ||
+ | |||
+ | ^Country | ||
+ | | United States | ||
+ | | Australia | ||
+ | | Switzerland | ||
+ | | Canada | ||
+ | \\ | ||
+ | **Action parameters: | ||
+ | > New column name: Deductions $ | ||
+ | > Expression: [Gross income] - [Disposable income] | ||
+ | |||
+ | \\ | ||
+ | **Result table:** | ||
+ | |||
+ | ^Country | ||
+ | | United States | ||
+ | | Australia | ||
+ | | Switzerland | ||
+ | | Canada | ||
+ | |||
+ | \\ \\ \\ | ||
+ | **Example #2:** Create multiple new columns within the same action. | ||
+ | |||
+ | \\ | ||
+ | **Action parameters: | ||
+ | > New column #1: MyDate = today() | ||
+ | > New column #2: MyYear = year([MyDate]) // | ||
+ | |||
+ | |||
+ | |||
+ | \\ | ||
+ | ====Community examples==== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | \\ | ||
+ | =====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 " | ||
+ | In either case, a new column with a default column name will appear //after// the selected column. | ||
+ | |||
+ | \\ | ||
+ | =====See also===== | ||
+ | * [[transformations: | ||
+ | * [[transformations: | ||
+ | * [[transformations: | ||
+ | * [[transformations: |
transformations/addcolumn.txt · Last modified: 2024/02/05 14:20 by craigt