AND Function: Difference between revisions
No edit summary |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
}} | }} | ||
This function returns the Boolean value "true" if both conditions are true. It is usually used in conjunction with the [[IF Function]]. | This function returns the Boolean value "true" if both conditions are true. It is usually used in conjunction with the [[IF Function]]. | ||
== Format == | == Format == | ||
*'''AND(condition1;condition2)''' | *'''AND(condition1;condition2)''' | ||
where: | where: | ||
*'''condition1 / condition2''' - logical expressions using >, <, =, >=, <=, !=, other functions, report column values or fields | *'''condition1 / condition2''' - logical expressions using >, <, =, >=, <=, !=, other functions, report column values or fields | ||
== Examples № 1 == | == Examples № 1 == | ||
<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;">IF(AND(D="Text in column";С>100500);"Good";"Bad")</div> | <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;">IF(AND(D="Text in column";С>100500);"Good";"Bad")</div> | ||
== Important == | == Important == | ||
Line 29: | Line 25: | ||
== Example № 2 == | == Example № 2 == | ||
<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:green"> | %%$<span style="color:green">IF</span>(<br> | ||
<span style="color:blue"><nowiki>{{Task.Notification}}</nowiki></span>=0<br> | <span style="color:blue"><nowiki>{{Task.Notification}}</nowiki></span>=0<br> | ||
<span style="color:red">&& </span><span style="color:blue"><nowiki>{{Task.Application through the form}}</nowiki></span>=1<br> | <span style="color:red">&& </span><span style="color:blue"><nowiki>{{Task.Application through the form}}</nowiki></span>=1<br> | ||
<span style="color:red">&& </span><span style="color:blue"><nowiki>{{Task.Who are you?}}</nowiki></span>="Physical person"<br> | <span style="color:red">&& </span><span style="color:blue"><nowiki>{{Task.Who are you?}}</nowiki></span>="Physical person"<br> | ||
<span style="color:red">&& </span><span style="color:blue"><nowiki>{{Task. | <span style="color:red">&& </span><span style="color:blue"><nowiki>{{Task.Select a predefined answer}}</nowiki></span>="Calculation.Legal Entity ."<br> | ||
)$%%<br> | )$%%<br> | ||
Invalid field value "Select a predefined answer" for the customer type "Physical person" | |||
%%$<span style="color:green"> | %%$<span style="color:green">ENDBLOCK</span>$%% | ||
'''The construction must be added in one line without spaces and line breaks:''' | '''The construction must be added in one line without spaces and line breaks:''' | ||
<nowiki>%%$IF({{Task."Disable field 07. Notification"}}=0&&{{Task.Application through the form}}=1&&{{Task.Who are you?}}="Physical person"&&{{Task. | <nowiki>%%$IF({{Task."Disable field 07. Notification"}}=0&&{{Task.Application through the form}}=1&&{{Task.Who are you?}}="Physical person"&&{{Task.Select a predefined answer}}="Calculation.Legal Entity")$%%Invalid field value "Select a predefined answer" for the customer type "Physical person" %%$ENDBLOCK$%%</nowiki> | ||
</div> | </div> | ||
== Important == | |||
*If no brackets are used in formulas, the AND operator (&&) has higher precedence than the [[OR Function | OR operator]] (||). | |||
Latest revision as of 12:42, 29 March 2024
This function returns the Boolean value "true" if both conditions are true. It is usually used in conjunction with the IF Function.
Format
- AND(condition1;condition2)
where:
- condition1 / condition2 - logical expressions using >, <, =, >=, <=, !=, other functions, report column values or fields
Examples № 1
Important
- The condition can be an arithmetic expression. If the result of this expression is a non-zero number, the condition is considered fulfilled. If the result of the expression is zero, the condition is not fulfilled.
- When checking values in custom checkbox fields, you should use 1 and 0 in reports and Yes / No in data tag calculated fields
- Function works only with two arguments.
Alternative use
In formulas, it is represented by two consecutive ampersand symbols — &&'
Example № 2
%%$IF(
{{Task.Notification}}=0
&& {{Task.Application through the form}}=1
&& {{Task.Who are you?}}="Physical person"
&& {{Task.Select a predefined answer}}="Calculation.Legal Entity ."
)$%%
Invalid field value "Select a predefined answer" for the customer type "Physical person"
%%$ENDBLOCK$%%
The construction must be added in one line without spaces and line breaks:
%%$IF({{Task."Disable field 07. Notification"}}=0&&{{Task.Application through the form}}=1&&{{Task.Who are you?}}="Physical person"&&{{Task.Select a predefined answer}}="Calculation.Legal Entity")$%%Invalid field value "Select a predefined answer" for the customer type "Physical person" %%$ENDBLOCK$%%
Important
- If no brackets are used in formulas, the AND operator (&&) has higher precedence than the OR operator (||).