---
title: "The “<> Not Equal To” Operator"
description: "In Assette, expressions are powerful tools used within Data Objects and Data Blocks to manipulate, compare, and evaluate data for client reports and presentations. One of the essential comparison operators available is the **`` Not Equal To Operator**. This operator…"
url: "https://learn.assette.com/docs/the-not-equal-to-operator/"
updated: "2024-11-18"
category: Developers / Developer Tools / Data Object Editor / Expressions
---

# The “<> Not Equal To” Operator

In Assette, expressions are powerful tools used within Data Objects and Data Blocks to manipulate, compare, and evaluate data for client reports and presentations. One of the essential comparison operators available is the **`<>` Not Equal To Operator**. This operator allows you to compare two values to determine if they are not equal, enabling conditional logic and data filtering within your expressions.

This article provides a comprehensive overview of how the `<>` operator works in Assette expressions, including its purpose, syntax, usage examples, and practical applications.

## Purpose of the `<>` Not Equal To Operator

The `<>` operator is used to compare two values or expressions to check if they are **not equal**. It returns a Boolean result:

- **`True`**: If the values on both sides of the operator are not equal.
- **`False`**: If the values are equal.

This operator is essential for implementing conditional logic, making decisions within expressions, and filtering data based on specific criteria.

## Syntax of the `<>` Operator

- **`value1`**: The first value or expression to compare.
- **`value2`**: The second value or expression to compare.

```
value1 <> value2
```

## Understanding How It Works

When you use the `<>` operator in an expression, Assette evaluates both `value1` and `value2` and compares their values:

- If `value1` and `value2` are **not equal**, the expression returns `True`.
- If they are equal, the expression returns `False`.

**Note**: Assette expressions are case-sensitive when comparing strings unless specified otherwise.

## Examples of Using the `<>` Operator

### Numeric Comparison

**Evaluation:**

- **5** is not equal to **10**.
- **Result:** `True`

```
5 <> 10
```

### String Comparison

**Evaluation:**

- The strings have different cases and are not identical.
- **Result:** `True`

```
"Assette" <> "assette"
```

### Variable Comparison

Assuming you have a variable `status`

**Evaluation:**

- Checks if `status` is not equal to `"Inactive"`.
- **Result:** Depends on the value of `status`.

```
status <> "Inactive"
```

## Important Considerations

### Data Types

- **Consistent Data Types**: Ensure that the values being compared are of compatible data types.
- **String Comparisons**: Be mindful of case sensitivity and whitespace in strings.

### Null and Undefined Values

- **Null Checks**: Use the `HasValue()` function to ensure variables are defined before comparison.

### Case Sensitivity

- **Case Conversion**: Use `ToLower()` or `ToUpper()` for case-insensitive comparisons.

### Logical Operators

- Combine the `<>` operator with logical operators like `and`, `or`, and `not` for complex conditions.

## Best Practices

1. **Explicit Comparisons**: Clearly specify both operands in the comparison.
2. **Consistent Formatting**: Be consistent with data formats (e.g., date formats) when comparing values.
3. **Use Parentheses for Clarity**: Group complex conditions with parentheses.
4. **Handle Null Values Appropriately**: Always check for null or undefined values to prevent errors.
5. **Test Expressions**: Regularly test expressions with different data inputs to ensure accuracy.
