# If (Int64)

| **Name**    | ***If (Int64)***                                                                                                                                                                                                                                                                                            |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax      | If (Boolean condition, Integer thenValue, Integer elseValue)                                                                                                                                                                                                                                                |
| Purpose     | To evaluate a given condition and if true, return result of thenValue. Otherwise, to return the result of elseValue.                                                                                                                                                                                        |
| Description | Returns the value of ‘Then’ expression or ‘Else’ expression depending on the value of condition.                                                                                                                                                                                                            |
| Return Type | Int64                                                                                                                                                                                                                                                                                                       |
| Parameters  | <p>Condition \[System.Boolean] – Condition that is evaluated</p><p>thenValue \[System.Int64] – This Parameter’s value is returned if the result of ‘condition’ parameter is true.</p><p>elseValue \[System.Int64] - This Parameter’s value is returned if the result of ‘condition’ parameter is false.</p> |

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/XSmkcgRElsmOSFF3p6jW/0.png)

**Example**

We have a *Customers* dataset which we will use to evaluate and transform the *Items* field.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/5GpnUIoYIjFjgXnmPnqe/1.png)

In this example we will use the *Expression* object to define the condition, and a *Variables* object to define *thenValue* and *elseValue*.

Where,

Condition: *Items* = “1”

*thenValue* = 100

*elseValue* ­ = 200

<figure><img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/Y6wZF6lFtwtwr65VUC8i/2.png" alt=""><figcaption></figcaption></figure>

In the output, you can see that Integer values, 100 and 200, have been returned depending on whether the *Items* field condition was met.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/S9hBjnth2D4KcEVsYnkJ/3.png)
