# MAX

The MAX function returns the largest number in a set of values. Node references are also accepted as arguments.

### Syntax

MAX(value1, ...valueN?) - > number

### Arguments

<table><thead><tr><th width="134">Arguments</th><th width="144">Data type</th><th width="448">Description</th></tr></thead><tbody><tr><td>value1</td><td>Number, Node reference</td><td>The nodes or numbers for which you want to evaluate the largest value.</td></tr><tr><td>...valueN?</td><td>Number, Node Reference</td><td>Additional nodes or numbers for which you want to evaluate the largest value. This is an optional argument.</td></tr></tbody></table>

### Example&#x20;

Consider the below example with a node that has the demand for a particular product for 12 months.

<figure><img src="https://261229348-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmXNCTvPRjJZj6UunHBgb%2Fuploads%2FFNC9uc5WmFRD6aQyLAhu%2Fimage.png?alt=media&#x26;token=7d5a5cb0-a18f-4f63-bdb6-b9ff90bdb2ff" alt=""><figcaption></figcaption></figure>

To calculate the maximum demand, the following formula should be written in the \[Maximum demand] node:

<mark style="color:blue;">**`MAX`**</mark>**`(`**<mark style="color:purple;">**`[Demand]`**</mark>**`.`**<mark style="color:blue;">**`ALL_PERIODS`**</mark>**`)`**

We are including [**.ALL\_PERIODS**](https://docs.valq.com/model/node-properties/node-properties-explanation#node-.all_periods) so that it will consider all the period values rather than one single period.

### Result

| **Maximum Demand** | 319 |
| ------------------ | --- |
