Difference between revisions of "IF a THEN b ELSE c"
DKontotasiou (talk | contribs) |
|||
Line 1: | Line 1: | ||
[[Category:Analytica User Guide]] | [[Category:Analytica User Guide]] | ||
− | < | + | <breadcrumbs>Analytica User Guide > Using Expressions > {{PAGENAME}}</breadcrumbs> |
− | + | ||
− | |||
This conditional expression returns '''b '''if '''a '''is true (1) or '''c '''if '''a '''is false (0), for example: | This conditional expression returns '''b '''if '''a '''is true (1) or '''c '''if '''a '''is false (0), for example: | ||
Line 19: | Line 18: | ||
==See Also== | ==See Also== | ||
− | + | <footer>Operators / {{PAGENAME}} / Function calls and parameters</footer> | |
− | |||
− | |||
− | |||
− | </ |
Revision as of 00:06, 5 November 2015
This conditional expression returns b if a is true (1) or c if a is false (0), for example:
Variable X := 1M
Variable Y := 1
IF X > Y THEN X ELSE Y → 1M
returns the larger of X
and Y
.
It is possible to omit the ELSE
clause:
IF X > Y THEN X
If the condition is false, it gives a warning. If you ignore the warning, it returns NULL
.
Conditional expressions get more interesting when they work on arrays. See IF a THEN b ELSE c with arrays.
See Also
Comments
Enable comment auto-refresher