Function: If

Description

Returns true value or false value from a condition.

Syntax

If(condition,true value,false value)

Arguments

condition can be any valid expression which performs a comparison, such as Amount>1000 or Quantity*Price=Total.

true value is the value returned if the condition is true.

false value is the value returned if the condition is false.

Return value

This function may return a number, a date or a character string.

Calculated field example

To create a Sale_price field that calculates a 20% discount off quantities of 5 or more, use the expression: If(Quantity>=5,Amount*0.80,Amount)

Quantity>=5 comparison expression: If the quantity is greater than or equal to 5, the function returns Amount*0.80, representing a 20% discount. For quantities less than 5, the function returns the full Amount field value, representing no discount.

Filter/Find example

The If() function has no practical application in filter or find expressions.

 

 

© 2024 Altair Engineering Inc. All Rights Reserved.

Intellectual Property Rights Notice | Technical Support