# Numbering

### Cumulative distribution

Return the relative rank of a row defined as NP/NR. NP is defined to be the number of rows that either precede or are peers with the current row. NR is the number of rows in the partition. –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#cume_dist)

```sql
CUME_DIST()
```

#### Return type

float

#### Parameters

### Dense rank

Returns the ordinal (1-based) rank of each row within the ordered partition. All peer rows receive the same rank value, and the subsequent rank value is incremented by one. –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#dense_rank)

```sql
DENSE_RANK()
```

#### Return type

integer

#### Parameters

### N-tile

Divides the rows into a set number of buckets based on row ordering and returns the 1-based bucket number that is assigned to each row. –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#ntile)

```sql
NTILE(@literal)
```

#### Return type

integer

#### Parameters

| Name       | Type                                                                                                                     | Allowed values                                                               | Required | Placeholder (in UI) |
| ---------- | ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------- | -------- | ------------------- |
| `@literal` | [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [integer](https://docs.redivis.com/reference/datasets/variables#integer) | true     | *(integer)*         |

### Percent rank

Return the percentile rank of a row defined as (RK-1)/(NR-1), where RK is the RANK of the row and NR is the number of rows in the partition. –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#percent_rank)

```sql
PERCENT_RANK()
```

#### Return type

float

#### Parameters

### Rank

Returns the ordinal (1-based) rank of each row within the ordered partition. All peer rows receive the same rank value. The next row or set of peer rows receives a rank value which increments by the number of peers with the previous rank value –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#rank)

```sql
RANK()
```

#### Return type

integer

#### Parameters

### Row number

Returns the sequential row ordinal (1-based) of each row for each ordered partition. If the no order condition is specified then the result is non-deterministic. –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#row_number)

```sql
ROW_NUMBER()
```

#### Return type

integer

#### Parameters


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.redivis.com/reference/workflows/transforms/variable-creation-methods/numbering.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
