Divooka Reference

Row Operations

11 nodes

On this page 11

Drop Empty Rows

Function

The rows with empty cells removed: a row goes when any of the chosen columns (every column when none are chosen) is empty - or, with All Empty, only when every one of them is. Text that is only spaces counts as empty here.

Signature
DropEmptyRows -> Table
    table: Table
    columns: Text Array
    allEmpty: Truth
Table DropEmptyRows(
    Table table,
    string[] columns,
    bool allEmpty = false)

Parameters

nametypedefaultdescription
tableTable—The rows to clean.
columnsText Array—The columns to look at; every column when empty.
allEmptyTruthFalseWhether a row goes only when all of those columns are empty.

Returns

TableTable
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Row Operations
Package
Data Analytics

Filter By Formula

Function

The rows for which a formula holds - Region = "West" and Units > 10 - and, on the second output, the rows for which it does not.

Signature
FilterByFormula -> (Matching: Table, notMatching: Table)
    table: Table
    formula: Text
    x: Any
    y: Any
Table FilterByFormula(
    Table table,
    string formula,
    object x,
    object y,
    out Table notMatching)

Parameters

nametypedefaultdescription
tableTable—The rows to filter.
formulaText—The condition, as a formula.
xAny—A value the formula can use as $x.
yAny—A value the formula can use as $y.

Returns

MatchingTable
notMatchingTable

Remarks

A row passes unless the formula gives false, an empty value, zero or empty text. Columns are named bare or in brackets ([Unit Price]); $x and $y are the values wired into X and Y. See Formula Column for the functions a formula can use.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Row Operations
Package
Data Analytics

Filter By Truths

Function

The rows where a column of truths is true - a condition built from other nodes - and, on the second output, the rest.

Signature
FilterByTruths -> (Matching: Table, notMatching: Table)
    table: Table
    keep: Column
Table FilterByTruths(
    Table table,
    Column keep,
    out Table notMatching)

Parameters

nametypedefaultdescription
tableTable—The rows to filter.
keepColumn—A Truth column as long as the table: true keeps a row.

Returns

MatchingTable
notMatchingTable
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Row Operations
Package
Data Analytics

Filter Rows

Function

The rows whose value in a column passes a comparison - equals, is greater than, contains, is one of and the rest - and, on the second output, the rows that do not.

Signature
FilterRows -> (Matching: Table, notMatching: Table)
    table: Table
    column: Text
    comparison: Filter Operator
    value: Text
    matchCase: Truth
Table FilterRows(
    Table table,
    string column,
    FilterOperator comparison,
    string value,
    bool matchCase,
    out Table notMatching)

Parameters

nametypedefaultdescription
tableTable—The rows to filter.
columnText—The column to test.
comparisonFilter Operator—How the column is compared with the value.
valueText—What the column is compared with; for "is one of", values separated by commas.
matchCaseTruth—Whether text must match in letter case too.

Returns

MatchingTable
notMatchingTable

Remarks

A column of numbers compares as numbers and a column of dates as dates, so "Price is greater than 10" and "Date is at least 2025-01-01" mean what they say. Text compares ignoring letter case unless Match Case is on. An empty cell matches only "is empty" and the negative comparisons.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Row Operations
Package
Data Analytics

Random Sample

Function

A random sample of rows, kept in their original order. The same seed draws the same rows every time - and the same rows Divooka Lite's Random Sample draws.

Signature
RandomSample -> Table
    table: Table
    count: Integer
    seed: Number
Table RandomSample(
    Table table,
    int count = 100,
    double seed = 42)

Parameters

nametypedefaultdescription
tableTable—The rows to sample.
countInteger100How many rows; a table with no more rows than this is returned whole.
seedNumber42Which sample: change it for another.

Returns

TableTable
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Row Operations
Package
Data Analytics

Remove Duplicates

Function

The rows with duplicates removed: a row is a duplicate when its values in the chosen columns (every column when none are chosen) repeat an earlier row's.

Signature
RemoveDuplicates -> Table
    table: Table
    columns: Text Array
    keepLast: Truth
Table RemoveDuplicates(
    Table table,
    string[] columns,
    bool keepLast = false)

Parameters

nametypedefaultdescription
tableTable—The rows to de-duplicate.
columnsText Array—The columns that decide what is a duplicate; every column when empty.
keepLastTruthFalseWhether to keep the last of each set of duplicates instead of the first.

Returns

TableTable
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Row Operations
Package
Data Analytics

Shuffle Rows

Function

The rows in a random order; the same seed gives the same order.

Signature
ShuffleRows(table: Table, seed: Number) -> Table
Table ShuffleRows(Table table, double seed = 42)

Parameters

nametypedefaultdescription
tableTable—The rows to shuffle.
seedNumber42Which order: change it for another.

Returns

TableTable
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Row Operations
Package
Data Analytics

Sort Rows

Function

The rows in order of one or more columns: the first column decides, the next breaks its ties, and so on. Empty values go last whichever way a column sorts, and rows that tie keep their order.

Signature
SortRows -> Table
    table: Table
    columns: Text Array
    descending: Truth Array
Table SortRows(Table table, string[] columns, bool[] descending)

Parameters

nametypedefaultdescription
tableTable—The rows to sort.
columnsText Array—The columns to sort by, most important first.
descendingTruth Array—For each column, whether it sorts largest first; ascending where not given.

Returns

TableTable

Remarks

Text sorts naturally - "item2" before "item10", letter case aside.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Row Operations
Package
Data Analytics

Split Rows

Function

The rows split at random into two parts - Fraction of them in the first, the rest in the second - as training and test sets are made. Each part keeps the table's order.

Signature
SplitRows -> (Part: Table, rest: Table)
    table: Table
    fraction: Number
    seed: Number
Table SplitRows(
    Table table,
    double fraction,
    double seed,
    out Table rest)

Parameters

nametypedefaultdescription
tableTable—The rows to split.
fractionNumber—The share of rows in the first part, between 0 and 1.
seedNumber—Which split: change it for another.

Returns

PartTable
restTable
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Row Operations
Package
Data Analytics

Take Rows

Function

Some rows by position: the first Count rows after skipping Skip of them, or - from the end - the last Count rows before the last Skip. A negative Count takes every row after the skip.

Signature
TakeRows -> Table
    table: Table
    count: Integer
    skip: Integer
    fromEnd: Truth
Table TakeRows(
    Table table,
    int count = 10,
    int skip = 0,
    bool fromEnd = false)

Parameters

nametypedefaultdescription
tableTable—The rows to take from.
countInteger10How many rows; negative for all of them.
skipInteger0How many rows to pass over first.
fromEndTruthFalseWhether to count from the last row instead of the first.

Returns

TableTable
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Row Operations
Package
Data Analytics

Top N

Function

The rows with the largest - or smallest - values of a column, largest first.

Signature
TopN -> Table
    table: Table
    column: Text
    count: Integer
    smallest: Truth
Table TopN(
    Table table,
    string column,
    int count = 10,
    bool smallest = false)

Parameters

nametypedefaultdescription
tableTable—The rows to choose from.
columnText—The column to rank by.
countInteger10How many rows.
smallestTruthFalseWhether to take the smallest values instead, smallest first.

Returns

TableTable
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Row Operations
Package
Data Analytics