User Tools

Site Tools


transformations:addcolumn

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
transformations:addcolumn [2021/07/19 00:42] craigttransformations:addcolumn [2024/02/05 14:20] (current) craigt
Line 21: Line 21:
 |Expression or Value|Options:  //It's an expression// or //It's a text or number// Enter the expression used to calculate the new column values,\\ or, enter the text or numeric value that will be repeated for all values.| |Expression or Value|Options:  //It's an expression// or //It's a text or number// Enter the expression used to calculate the new column values,\\ or, enter the text or numeric value that will be repeated for all values.|
 |Position|Choose where the new column(s) will appear in the dataset.  Options:  //Rightmost//, //Leftmost//, or //After column//\\ (and select the column the new column(s) will appear after).| |Position|Choose where the new column(s) will appear in the dataset.  Options:  //Rightmost//, //Leftmost//, or //After column//\\ (and select the column the new column(s) will appear after).|
 +|If column already exists|Choose how EasyMorph reacts if the new column name already exists in the dataset.\\  Options: //Rename new column// (a sequential number is appended to the column name), //Do not create new column//\\ (the column is not created and the workflow continues), or //Fail// (the action displays an error and the workflow stops).|
  
 \\  \\ 
 =====Remarks===== =====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 from one row to another row or to another table.+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.\\ 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.  (See example, below)
 +
  
 \\  \\ 
 =====Examples===== =====Examples=====
  
-**Example:** Calculate the $ amount of compulsory deductions for each country+**Example #1:** Calculate the $ amount of compulsory deductions for each country
  
 **Source table:** Average income and deductions **Source table:** Average income and deductions
Line 53: Line 57:
 | Switzerland  |  53716|  48414|  9.87%|  5302| | Switzerland  |  53716|  48414|  9.87%|  5302|
 | Canada  |  45896|  37469|  18.36%|  8427| | Canada  |  45896|  37469|  18.36%|  8427|
 +
 +\\ \\ \\ 
 +**Example #2:** Create multiple new columns within the same action.
 +
 +\\ 
 +**Action parameters:**
 +> New column #1: MyDate = today()
 +> New column #2: MyYear = year([MyDate]) //(References the [MyDate] column previously created in this action.)//
 +
 +
  
 \\  \\ 
transformations/addcolumn.txt · Last modified: 2024/02/05 14:20 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki