Transform Function Details

Overview

The Transform Function in K3 Labs is designed to enable users to manipulate and process data in workflows with a range of customizable options. Below, you can find a breakdown of how the function setup and key features work.

Setup Components:

  1. Field Selector: Allows users to select fields for formula creation, similar to the IF function.

  2. Variable Field: A variable selector allowing users to add input points into their formulas.

Note: One transform function can perform one action.

Formula Functions:

Upon selecting the formula option, users can choose from a drop-down menu with various mathematical, string, and array operations, categorized as follows:

  1. Min/Max Functions

    1. Min: Returns the smallest value from a set of inputs.

    2. Max: Returns the largest value from a set of inputs.

  2. Operations

    1. Addition (+): Adds two or more values.

    2. Subtraction (-): Subtracts one value from another.

    3. Division (/): Divides one value by another.

    4. Multiplication (*): Multiplies two or more values.

  3. Math Functions

    1. Abs: Returns the absolute value.

    2. Average: Calculates the average of a set of numbers.

    3. Floor: Rounds a number down to the nearest integer.

    4. Median: Finds the median value in a set of numbers.

    5. Mod: Returns the remainder from a division.

    6. Rand: Generates a random number.

  4. String Functions

    1. Length: Returns the length of a string.

    2. LowerCase: Converts text to lowercase.

    3. UpperCase: Converts text to uppercase.

    4. REGEX_Replace: Replaces a substring using regular expressions.

    5. Replace: Replaces occurrences of a string with another string.

    6. Substring: Extracts a portion of a string.

    7. Trim: Removes leading and trailing spaces.

    8. TrimLeft: Removes spaces from the beginning of a string.

    9. TrimRight: Removes spaces from the end of a string.

  5. Array Functions. Based on JavaScript array methods, allowing advanced operations on lists and data arrays.

    1. Find: Returns the first element that meets a condition.

    2. Every: Checks if all elements meet a condition.

    3. Some: Checks if at least one element meets a condition.

    4. FindIndex: Returns the index of the first element that satisfies the condition.

    5. Flat: Flattens an array.

    6. Filter: Filters elements based on a condition.

    7. At: Returns the element at a specific index in the array.

Last updated