# FINDFIRST
URL: https://docs.valsight.ai/findfirst/
Description: Returns the first defined value per group along a given level. If no level is given, the function automatically uses the lowest level in the time dimension used by the node.
**Category:** [Filtering & data shaping](/filtering-data-shaping/)

## Overview

The **FINDFIRST** function **returns the first defined value per group along a given level**. If no level is given, the function automatically uses the lowest level in the time dimension used by the node.

Use this function when you need to select one representative value per group, for example the first entry per product or the starting value in a time series.

It is often paired with [TRUE](/true/) to generate starting values, for example with [SCHEDULEPROJECTS](/scheduleprojects/): `TRUE(FINDFIRST('Node'))`.

## Syntax

`FINDFIRST('Node'[, "Level"])`

## Parameters

| Parameter | Description                                                                                                  | Type           | Required |
| --------- | ------------------------------------------------------------------------------------------------------------ | -------------- | -------- |
| **Node**  | Input node.                                                                                                  | Node reference | Yes      |
| **Level** | The name of the level to find the first values in respect to. Defaults to the lowest time level on the node. | Level name     | No       |

## Watch out

An error will occur:

* If no level is provided and the node does not use the **time dimension**.
* The **level must be present** on the entered node.
* The level to find can **not be higher** in the dimension than the level used in the node (e.g. if the node uses `"Month"` the level can not be `"Year"`).
  * Hint: use [ROLLUP](/rollup/) or [DROPLEVEL](/droplevel/) in this case.

## Example

### First value per product along the time dimension

This example returns only the earliest defined value for each product. Products with gaps retain only the first year's value.

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

|           | 2025 | 2026 | 2027 | 2028 |
| --------- | ---- | ---- | ---- | ---- |
| Product A | 4.5  | 4.5  |      | 4.5  |
| Product B |      | 5    | 6    | 6.4  |
| Product C |      |      |      | 7    |
| Product D |      |      | 5.6  | 5.6  |

**Formula:** `FINDFIRST('Node A')`

**Equivalent to:** `FINDFIRST('Node A', "Year")`

|           | 2025 | 2026 | 2027 | 2028 |
| --------- | ---- | ---- | ---- | ---- |
| Product A | 4.5  |      |      |      |
| Product B |      | 5    |      |      |
| Product C |      |      |      | 7    |
| Product D |      |      | 5.6  |      |

## Related Functions

| Function                    | When to use instead                                                                                                          |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [ENUM](/enum/)              | When you want an index or ordering helper based on measure values rather than selecting one value per group.                 |
| [ENUM\_LEVEL](/enum-level/) | When you want an index based on the order of level values in dimension management rather than selecting one value per group. |
