Column Operations
12 nodes
On this page 12
Add Column
FunctionThe table with a column added at the end - or put in place of the column of that name, ignoring letter case.
AddColumn(table: Table, name: Text, column: Column) -> Table
Table AddColumn(Table table, string name, Column column)
Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table. |
| name | Text | — | The new column's name. |
| column | Column | — | The column, as long as the table. |
Returns
| Table | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Column Operations
- Package
- Data Analytics
Change Type
FunctionThe table with columns converted to another kind - Number, Text, Truth or Date & Time. Values that do not convert become empty, and Failures counts them.
ChangeType -> (result: Table, failures: Integer)
table: Table
columns: Text Array
type: ColumnType
dateFormat: TextTable ChangeType(
Table table,
string[] columns,
ColumnType type,
string dateFormat,
out int failures)Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table. |
| columns | Text Array | — | The columns to convert. |
| type | ColumnType | — | The kind to convert them to. |
| dateFormat | Text | — | For dates, a format to read them by exactly, such as dd/MM/yyyy; empty to recognise the usual forms. |
Returns
| Table | Table |
| failures | Integer |
Remarks
Converting is forgiving: numbers lose their currency signs, percent signs and spaces ("$1,200" is 1200), truths accept yes/no, y/n, on/off and 1/0, and dates accept ISO dates, month-first dates and spelled-out months - or exactly the Date Format given, such as dd/MM/yyyy.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Column Operations
- Package
- Data Analytics
Drop Columns
FunctionEvery column but these.
DropColumns(table: Table, columns: Text Array) -> Table
Table DropColumns(Table table, string[] columns)
Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table. |
| columns | Text Array | — | The columns to drop. |
Returns
| Table | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Column Operations
- Package
- Data Analytics
Fill Empty Cells
FunctionThe table with its empty cells filled: with a value, with zero, from the nearest value above or below, with the column's mean or median, or along a straight line between the values on either side.
FillEmptyCells -> Table
table: Table
columns: Text Array
strategy: Fill Strategy
value: TextTable FillEmptyCells(
Table table,
string[] columns,
FillStrategy strategy = FillStrategy.Value,
string value = "")Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table. |
| columns | Text Array | — | The columns to fill; every column when empty. |
| strategy | Fill Strategy | Value | What to fill with. |
| value | Text | — | The value, when filling with a value; read as the column's kind. |
Returns
| Table | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Column Operations
- Package
- Data Analytics
Formula Column
FunctionA column computed from a formula over each row - Units * [Unit Price], IF(Revenue > 1000, "large", "small"), YEAR(Date) - added at the end, or put in place of the column of that name.
FormulaColumn -> Table
table: Table
name: Text
formula: Text
x: Any
y: AnyTable FormulaColumn(
Table table,
string name = "Result",
string formula = "",
object x,
object y)Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table. |
| name | Text | Result | The new column's name. |
| formula | Text | — | The formula. |
| x | Any | — | A value the formula can use as $x. |
| y | Any | — | A value the formula can use as $y. |
Returns
| Table | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Column Operations
- Package
- Data Analytics
Get Column
FunctionOne column of a table, to work on by itself.
GetColumn(table: Table, column: Text) -> Column
Column GetColumn(Table table, string column)
Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table. |
| column | Text | — | The column's name. |
Returns
| Column | Column |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Column Operations
- Package
- Data Analytics
Rename Columns
FunctionThe table with columns renamed: each of From becomes the To in the same position.
RenameColumns -> Table
table: Table
from: Text Array
to: Text ArrayTable RenameColumns(Table table, string[] from, string[] to)
Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table. |
| from | Text Array | — | The current names. |
| to | Text Array | — | The new names, in the same order. |
Returns
| Table | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Column Operations
- Package
- Data Analytics
Rolling Calculation
FunctionA column calculated over a moving window of rows: each row gets the mean, sum, minimum, maximum, median, standard deviation, variance or count of the Window rows ending at it - for the whole table or within each group.
RollingCalculation -> Table
table: Table
column: Text
window: Integer
operation: Rolling Operation
minimumValues: Integer
groupBy: Text
name: TextTable RollingCalculation(
Table table,
string column,
int window = 7,
RollingOperation operation = RollingOperation.Mean,
int minimumValues = 0,
string groupBy = "",
string name = "")Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table, in the order the window should move. |
| column | Text | — | The column of numbers. |
| window | Integer | 7 | How many rows the window holds. |
| operation | Rolling Operation | Mean | What to calculate over each window. |
| minimumValues | Integer | 0 | How many values a window needs to give a result; 0 for a whole window. |
| groupBy | Text | — | A column to move the window within each value of, separately; empty for the whole table. |
| name | Text | — | The new column's name; "7-row mean of Sales" and the like when empty. |
Returns
| Table | Table |
Remarks
A row whose window holds fewer values than Minimum Values (the whole window when 0) is empty - so a 7-day average starts on the seventh day.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Column Operations
- Package
- Data Analytics
Running Calculation
FunctionA column calculated down another, row after row: a running total, average, maximum or minimum, the difference or percent change from the previous row, each row's share of the total, its rank, or its row number - for the whole table or within each group.
RunningCalculation -> Table
table: Table
operation: Running Operation
column: Text
groupBy: Text
name: TextTable RunningCalculation(
Table table,
RunningOperation operation = RunningOperation.RunningSum,
string column = "",
string groupBy = "",
string name = "")Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table, in the order the calculation should run. |
| operation | Running Operation | Running sum | What to calculate. |
| column | Text | — | The column of numbers to calculate down; not needed for Row Number. |
| groupBy | Text | — | A column to calculate within each value of, separately; empty for the whole table. |
| name | Text | — | The new column's name; "Running total of Revenue" and the like when empty. |
Returns
| Table | Table |
Remarks
An empty value gives an empty result in its own row, and the calculation carries on past it. Ranks put the largest value first.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Column Operations
- Package
- Data Analytics
Select Columns
FunctionOnly these columns, in this order.
SelectColumns(table: Table, columns: Text Array) -> Table
Table SelectColumns(Table table, string[] columns)
Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table. |
| columns | Text Array | — | The columns to keep, in the order wanted. |
Returns
| Table | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Column Operations
- Package
- Data Analytics
Shift Column
FunctionA column of another column's values moved down by Periods rows - each row gets the value from that many rows before it, or after it when Periods is negative - for the whole table or within each group.
ShiftColumn -> Table
table: Table
column: Text
periods: Integer
groupBy: Text
name: TextTable ShiftColumn(
Table table,
string column,
int periods = 1,
string groupBy = "",
string name = "")Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table, in the order to shift along. |
| column | Text | — | The column to shift; any kind. |
| periods | Integer | 1 | How many rows to move down; negative moves up. |
| groupBy | Text | — | A column to shift within each value of, separately; empty for the whole table. |
| name | Text | — | The new column's name; "Previous Revenue" and the like when empty. |
Returns
| Table | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Column Operations
- Package
- Data Analytics
Split Column
FunctionA column of text split into several at a delimiter: "Ada Lovelace" split at a space into Name 1 and Name 2. The last part keeps whatever text remains.
SplitColumn -> Table
table: Table
column: Text
delimiter: Text
parts: Integer
keepOriginal: TruthTable SplitColumn(
Table table,
string column,
string delimiter = ",",
int parts = 2,
bool keepOriginal = false)Parameters
| name | type | default | description |
|---|---|---|---|
| table | Table | — | The table. |
| column | Text | — | The column to split. |
| delimiter | Text | , | What to split at. |
| parts | Integer | 2 | How many columns to make, from 1 to 50. |
| keepOriginal | Truth | False | Whether to keep the original column beside the parts. |
Returns
| Table | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Column Operations
- Package
- Data Analytics