Function Nesting: Difference between revisions

From Planfix
Jump to: navigation, search
No edit summary
Tag: Manual revert
No edit summary
 
Line 61: Line 61:
For example:
For example:
<div style="display: block; padding: 1em; margin: 0 0 10px; font-size: 13px; line-height: 1.65; color: black; word-wrap: break-word; background-color: #f9f9f9; border: 1px solid #ddd; border-radius: 4px;">
<div style="display: block; padding: 1em; margin: 0 0 10px; font-size: 13px; line-height: 1.65; color: black; word-wrap: break-word; background-color: #f9f9f9; border: 1px solid #ddd; border-radius: 4px;">
<span style="color:red;">IF(</span><span style="color:green;">AND(<span style="color:blue;">AND({{System.Today.Number}}=19;{{Task.Full days}}>15)</span>;In queue="In progress")</span><span style="color:red;">;"Finishing";"Something is missing")</span>
<span style="color:red;">IF(</span><span style="color:green;">AND(<span style="color:blue;">AND(<nowiki>{{System.Today.Number}}=19</nowiki>;<nowiki>{{{Task.Full days}}>15)</nowiki></span>;In queue="In progress")</span><span style="color:red;">;"Finishing";"Something is missing")</span>
</div>
</div>



Latest revision as of 14:51, 5 January 2024

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({{System.Today.Number}}=19;{{{Task.Full days}}>15);In queue="In progress");"Finishing";"Something is missing")


Go To