Function Nesting

From Planfix
Revision as of 14:48, 5 January 2024 by Aliona (talk | contribs)
Jump to: navigation, search

Functions in Planfix support nesting. This means that any of the function arguments can be replaced by another function as long as the type of the result (string, number, date) matches the type of the function you added it to.

Important

All functions that are used instead of an argument in another function must contain the number of arguments and the order specified in the help section of the added function.

CONCATENATE Function

The CONCATENATE function contains three arguments:

CONCATENATE("Text_1";"Separator";"Text_2")

Arguments:

  • Text_1 — the text to be joined. Instead of an argument, you can add another function over strings.
  • Separator — can be anything, even a space — ". "
  • Text_2 — the text to be joined. Instead of an argument, you can add another function over strings.

Instead of the Text_1 argument, you can add another function over strings. For example, add another CONCATENATE function. It is important to specify all the arguments of the function as in the manual:

CONCATENATE(CONCATENATE("Text_1";"Separator";"Text_2");"Separator";"Text_2")

Note that the function added instead of an argument does not need to be enclosed in double-quotes.

Arguments for the new function:

  • CONCATENATE("Text_1";"Separator";"Text_2")
  • Text_2

Using this method, you can form functions with different levels of nesting.


IF Function

Contains three arguments:

IF(condition;value_yes;value_no)

Arguments:

  • Condition — a logical expression with the symbols >, <, =, >=, <=, !=, another function or a value. The AND function is often used.
  • value_yes — a numeric value or string value, the final result of the function if the condition is met.
  • value_no — a numeric value or a string, the final result of the function if the condition is not met.

Instead of the condition, you can use the AND function:

AND(condition1;condition2)

As a result, the IF function will look like this:

IF(AND(condition1;condition2);value_yes;value_no)

If you have a more complex task, for example, the function must check three conditions at once, then use the nesting of the AND function:

IF(AND(AND(condition1;condition2);condition2);value_yes;value_no)

For example:

IF(AND(AND(Template:System.Today.Number/span>=19;Template:Task.Full days>15);In queue="In progress");"Finishing";"Something is missing")


Go To