# MULTIPLY
URL: https://docs.valsight.ai/multiply/
Description: The MULTIPLY function extends the * operator with optional validation for missing rows. It produces the same result as 'Node1' * 'Node2' when validation passes. When validation fails, it produces an error with a detailed explanation of which rows are missing.
**Category:** [Math & numeric](/math-numeric/)

## Overview

The **MULTIPLY** function **extends the** `*` **operator with optional validation for missing rows**. It produces the same result as `'Node1' * 'Node2'` when validation passes. When validation fails, it produces an error with a detailed explanation of which rows are missing.

Use this function when you want standard multiplication but need to detect mismatches between the two input nodes.

## Syntax

`MULTIPLY('Node1', 'Node2' [, "Validation"])`

**Example usage:** `MULTIPLY('Volume', 'Price', "FailOnMissing")`

## Parameters

| Parameter      | Description                                                                        | Type           | Required | Default          |
| -------------- | ---------------------------------------------------------------------------------- | -------------- | -------- | ---------------- |
| **Node1**      | First factor node, specified using the node name in single quotes (e.g.`'Volume'`) | Node reference | Yes      | --               |
| **Node2**      | Second factor node, specified using the node name in single quotes (e.g.`'Price'`) | Node reference | Yes      | --               |
| **Validation** | Controls how mismatches between the two input nodes are handled.                   | Keyword        | No       | `"NoValidation"` |

**Validation options:**

* `"NoValidation"`: No mismatch check. Behaves exactly as the `*` operator. This is the default.
* `"FailOnMissingFirst"`: Fails if any row in Node1 has no matching row in Node2.
* `"FailOnMissingSecond"`: Fails if any row in Node2 has no matching row in Node1.
* `"FailOnMissing"`: Fails if either node has rows not matched by the other (combines both checks).

## Output shape

| Aspect         | Behavior                                                                                                        |
| -------------- | --------------------------------------------------------------------------------------------------------------- |
| Dimensionality | **Union** of all dimensions from both inputs (same as `*`). Per shared dimension, the **finest** level is used. |
| Level values   | Matched on shared dimensions. Non-shared dimensions are applied across all matching rows.                       |
| Row count      | Equal or expanded. Where one input has no matching value, the result is **0** (not N/A).                        |

## Watch out

* Using validation has a **performance impact**. Only use it when you need to detect mismatches.
* Without validation (or with `NoValidation`), MULTIPLY is identical to `*`. Where one input has no matching value for a row, the result is **0**.

## Example

### Validation behavior

This example shows the default multiplication result and how the different validation modes behave when the two input nodes do not fully overlap. The missing years at the start and end of the time range trigger the validation errors.

**Input node:** `'Node1'`

| Year | Value |
| ---- | ----- |
| 2026 | 6     |
| 2027 | 4     |
| 2028 | 10    |

**Input node:** `'Node2'`

| Year | Value |
| ---- | ----- |
| 2025 | 2     |
| 2026 | 3     |
| 2027 | 1     |

**Formula:** `MULTIPLY('Node1', 'Node2')`

**Equivalent to:** `MULTIPLY('Node1', 'Node2', "NoValidation")`

| Year | Calculation | Result |
| ---- | ----------- | ------ |
| 2025 | N/A × 2     | 0      |
| 2026 | 6 × 3       | 18     |
| 2027 | 4 × 1       | 4      |
| 2028 | 10 × N/A    | 0      |

**Formula:** `MULTIPLY('Node1', 'Node2', "FailOnMissingFirst")`

**Error:** The calculation fails because year 2028 from `Node1` has no matching value in `Node2`.

**Formula:** `MULTIPLY('Node1', 'Node2', "FailOnMissing")`

**Error:** The calculation fails because year 2028 from `Node1` has no matching value in `Node2` and year 2025 from `Node2` has no matching value in `Node1`.

**Formula:** `MULTIPLY('Node1', 'Node2', "FailOnMissingSecond")`

**Error:** The calculation fails because year 2025 from `Node2` has no matching value in `Node1`.

## Related

| Function                                | When to use instead                                                                                                 |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [MULTIPLICATION (\*)](/multiplication/) | When you want standard multiplication across shared levels without additional validation handling.                  |
| [DIVIDE](/divide/)                      | When you need the same kind of validated arithmetic behavior but want to divide values instead of multiplying them. |
