# EQ (=)
URL: https://docs.valsight.ai/eq/
Description: Checking whether matching rows are equal
**Category:** [Logical functions](/logical-functions/)

## Overview

The **EQ** function **compares the rows of two inputs** and returns true (1) if the values are equal and false (0) otherwise.

Use this function when you need a 1/0 flag to mark matching values between two inputs.

## Syntax

`EQ('Node1', 'Node2')`

`'Node1' = 'Node2'`

## Parameters

| Parameter | Description                                                                         | Type           | Required |
| --------- | ----------------------------------------------------------------------------------- | -------------- | -------- |
| **Node1** | First input node, specified using the node name in single quotes (e.g. `'Profit'`). | Node reference | Yes      |
| **Node2** | Second input node.                                                                  | Node reference | Yes      |

## Example

### Checking whether matching rows are equal

This example compares two input nodes row by row. The result returns 1 where both values are equal and 0 where they differ.

**Input node:** `'A'`

| Year | Value |
| ---- | ----- |
| 2025 | 350   |
| 2026 | 700   |
| 2027 | 850   |
| 2028 | 500   |

**Input node:** `'B'`

| Year | Value |
| ---- | ----- |
| 2025 | 350   |
| 2026 | 400   |
| 2027 | 850   |
| 2028 | 600   |

**Formula:** `EQ('A', 'B')`

| Year | EQ Result |
| ---- | --------- |
| 2025 | 1         |
| 2026 | 0         |
| 2027 | 1         |
| 2028 | 0         |

## Related Functions

| Function          | When to use instead                                                                                |
| ----------------- | -------------------------------------------------------------------------------------------------- |
| [NEQ (!=)](/neq/) | When you want to mark mismatches instead of matching values between two inputs.                    |
| [GT (>)](/gt/)    | When you need to check whether one input is greater than another instead of checking for equality. |
| [LT (<)](/lt/)    | When you need to check whether one input is less than another instead of checking for equality.    |
