Nektion has a slew of built-in functions and operators to make building formulae as easy as possible. Below is a table detailing how to use the functions and how they work.

Click here to view the operators or alternatively, scroll to the bottom of the page.

# Nektion functions

Category | Name | Returns | Usage | Description |
---|---|---|---|---|

Logic | IF | IF(condition, thenExpression, elseExpression) | Executes different expressions depending on the truth value of the condition. | |

Logic | AND | Boolean | AND(arg...) | Returns true if all arguments evaluate to true |

Logic | OR | Boolean | OR(arg...) | Returns true if any of the arguments evaluate to true |

Logic | NOT | Boolean | NOT(arg) | Returns true if the argument is false, and vice versa. |

Logic, Sorting | ASC | Items | ASC(args, criterion) | Returns the arguments sorted by the criterion in ascending order |

Logic, Sorting | DESC | Items | DESC(args, criterion) | Returns the arguments sorted by the criterion in descending order |

Date and time | TIMESTAMP | Timestamp | TIMESTAMP(timestring) | Parses the time value of a string and returns the equivalent Unix timestamp. |

Date and time | NOW | Timestamp | NOW() | Returns the current time as timestamp. The timestamp is refreshed every 15 minutes. |

Date and time | ATTIME | ATTIME(timestamp, formula) | Evaluates the formula at the given timestamp. This can be used to calculate historical metrics and as a results calculate how metrics have changed. | |

Date and time | ASDATESTRING | Date | ASDATESTRING(date, [format]) | Parses the date parameter and formats it with the optional format parameter (default format is 'YYY-MM-DD). The date parameter can be a timestamp, a date or a string representation of a date. |

Graph | NODE | Graph | NODE() | |

Graph | PAGE | Graph | PAGE() | |

Graph | ROW | Graph | ROW() | Reference to the current row item (for cards in a board view) |

Graph | ITEM | Graph | ITEM() | Reference to the current item. Generally used to reference the current item while filtering graphs. |

Graph | VIEW | Graph | VIEW() | Returns the current view item (e.g. Tree, Board). Generally used in creating custom local filters. |

Graph | COLUMN | Graph | COLUMN() | Returns reference to the current column item (for cards in a board view). |

Graph | VIEWITEMS | Graph | VIEWITEMS() | Returns the items in the current view (e.g. items in a tree) |

Date and time | FIRSTLINKED | Timestamp | FIRSTLINKED(relationtype, items) | Returns the earliest date at which a specific relation was created. |

Date and time | LASTLINKED | Timestamp | LASTLINKED(relationtype, items) | Returns the latest date at which a specific relation was created. |

Date and time | TIMELINKED | TIMELINKED(relationtype, items) | How long (in seconds) current item has been linked with specific relation type(s) or contexts to any of the items given as parameters. | |

Math | MAX | Integer | MAX(arg...) | Returns the largest number among its arguments. |

Math | MIN | Integer | MIN(arg...) | Returns the smallest number among its arguments. |

Math | COUNT | Number | COUNT(items...) | Returns the number of items passing through the filter |

Logic | FUSE | FUSE(formula...) | Returns the first value of the first parameter that is defined. Useful for backup logic, e.g. to use the actual start date for items, and estimated date if item is not started. | |

Logic | ISEMPTY | Boolean | ISEMPTY(formula) | Returns true if the parameter returns an empty result or nothing, otherwise returns false. |

Graph | FLATTEN | List | FLATTEN(tree) | Flatten a graph into a one-dimensional result set. Consider flattening a graph with the _| operator |

Graph | UNION | Graph | UNION(graph...) | Returns a flattened graph of items from all of the graph supplied as parameters. |

Graph | INTERSECTION | Graph | INTERSECTION(graph...) | Returns a flattened graph of items that appear in every graph supplied as a parameter. |

Graph | FILTER | Graph | FILTER(formula, criterion) | Same as | operator. Used for filtering graphs |

Logic | ISADMIN | Boolean | ISADMIN() | Returns true if the logged-in user is an admin. Might be used for example in hidden fields for widgets. |

Logic | ISITEM | Boolean | ISITEM(arg...) | Returns true if current item, as retrieved with ITEM() function, is any of the items given as parameters |

Date and time | ATNOW | ATNOW(formula) | Returns the value of the formula at current time. Used mainly in time series to get up to date configuration data when time series values are evaluated over time. | |

Graph | WITHALLITEMS | WITHALLITEMS(formula) | Returns the value of the formula without filtering out template and other admin items. | |

Graph | RANK | RANK(formula, contextformula) | Rank the graph returned from formula with the rank context returned by rank context formula. | |

Graph | REFERENCESTO | Graph | REFERENCESTO(reference) | Returns all items that have a formula field that references the parameter |

Logic | ISLINKED | Boolean | ISLINKED(typeCriterion, criterion) | returns true if the current item has a relation that matches the arguments |

Logic | TYPE | Boolean | TYPE(itemtype...) | Returns true if the current item's type matches one of the arguments. |

Logic | HASRANK | Boolean | HASRANK(contextformula) | Returns true if the current item has a rank in the context provided by the formula given as parameter. Generally used when having a rank is used to mark is an item is prioritized in certain context. |

Logic | ISLINKING | Boolean | ISLINKING(relationtypes,targetitems) | Returns true if the item is currently being linked to any of the target items with any of the listed relation types. This is generally used to determine that you can create or move something to a view, but after creation or move the items are not shown in that view. |

Logic | ISROOT | Boolean | ISROOT() | Returns true if the current node is a root of the graph |

Logic | ISCOLUMN | Boolean | ISCOLUMN() | Returns true if the current node is the current column item |

Logic | ISROW | Boolean | ISROW() | Returns true if the current node is the current row item |

Logic | ISPAGE | Boolean | ISPAGE() | Returns true if the current item is the same as the page item |

Graph | ITEMS | Graph | ITEMS(item...) | Returns a flat graph containing the specified items. |

Graph | ITEMSOFTYPE | Graph | ITEMSOFTYPE(itemtype...) | Returns a graph containing all of the items of the specified item types. |

Graph | HOP | HOP(root, relationtypes) | Same as -> operator | |

- | VAL | * | VAL(item) | Returns the value of the item, for example a date field associated with a parent item. |

Math | ROUND | Number | ROUND(value, precision) | Rounds the given value to the chosen number of decimals. |

Graph | USER | USER() | Returns the user item for the currently logged in user. Generally used for restricting the visibility of some fields to members of some groups, or in options to suggest the current user as responsible etc. | |

JOINA | String | JOINA(graph, field, [delimiter]) | Returns a comma (or the optional delimiter) separated string of values of items in the graph. |

# Nektion operators

Operator | Description | Usage | Example |
---|---|---|---|

->> | Expand forward (graph) | startgraph ->> relation | NODE() ->> "Project has sprints":1235 |

<<- | Expand backward (graph) | startgraph <<- relation | NODE() <<- "Project has sprints":1235 |

-> | Hop forward (graph) | startgraph -> relation | NODE() -> "User has stories":1532 |

<- | Hop backward (graph) | startgraph <- relation | NODE() <- "User has stories":1532 |

| | Filter items. | graph | filter | NODE() | TYPE("Story":7676) |

_| | Flatten a graph and then filter it. Equivalent to combining FLATTEN() and |. | graph _| filter | NODE() ->> "Project has sprints":1235 & "Sprint has stories":5424 _| TYPE( "Sprint":6655, "Story":7676 ) |

= | Equals (numeric) | value1 = value2 | ITEMSOFTYPE("Story") | ( VAL("Priority") = 3 ) |

>= | Greater than or equals (numeric) | value1 >= value2 | NODE() | NOW() >= TIMESTAMP("2021-06-23") ) |

<= | Less than or equals (numeric) | value1 <= value2 | NODE() &<- "User has stories":1532 | ( VAL("Start date":110) <= TIMESTAMP("2021-06-23") ) |

> | Greater than (numeric) | value1 > value2 | NODE() | NOW() > TIMESTAMP("2021-06-23") ) |

< | Less than (numeric) | value1 < value2 | NODE() &<- "User has stories":1532 | ( VAL("Start date":110) < TIMESTAMP("2021-06-23") ) |

& | Strings: concatenate Graphs: combine relation types | string1 & string2 graph -> relation1 & relation2 & relation3 | "User has stories":1532 & "Story has details":12931">"Due date: " & VAL("Due date":111) NODE() -> "User has stories":1532 & "Story has details":12931 |

+ | Addition | value1 + value2 | NODE() <- "User has stories":1532 | ( VAL("Start date":110) < TIMESTAMP("2021-06-23") + DAYS(100) ) |

- | Subtraction | value1 - value2 | NODE() <- "User has stories":1532 | ( VAL("Start date":110) < TIMESTAMP("2021-06-23") - DAYS(100) ) |