---
title: ROWNUMBERX
description: Learn how to use the ROWNUMBERX function to assign row numbers based on specific conditions in your dataset, enhancing data analysis.
---
import { Aside, Steps } from '@astrojs/starlight/components';

# ROWNUMBERX

The ROWNUMBERX function is an extension of the [ROWNUMBER](/insights-v8/configure-expression/networkdays/) function that allows you to assign row numbers based on a specified condition

## Applicable to

Calculated Columns

## Return Value

The return value of the ROWNUMBERX function in Infoveave is an integer that represents the position of each row in the dataset that meets the specified condition.

## Remark

* The ROWNUMBERX function returns an integer that represents the row number for rows that meet the specified condition.
* If any rows do not meet the condition, the ROWNUMBERX function will assign the previous row numbers and continues until the condition is met.
* If the first row does not meet the condition, the ROWNUMBERX function will assign 0 to the first row and continues until the condition is met. Once the condition is met the ROWNUMBERX function will assign 1 to the row number.

## Syntax

```
ROWNUMBERX(<expression>,condition)
```

## ROWNUMBERX in Calculated Columns



| Parameter       | Description                                                                        |
|-----------------|------------------------------------------------------------------------------------|
| Expression       | A placeholder in a function that is replaced with the column names.             |
| Condition        | A placeholder in a function that is replaced with the condition filter.           |
| Column Name      | The name of the column in the dataset or Datasource that contains the values you want to analyze. |
| Filter Condition | A filter condition returns the data points that meet the defined condition that you want to analyze. The filter condition can be either a string or a numeric. |

Steps to Use

<Steps>
1. Write the ROWNUMBERX function. For instance ```ROWNUMBERX(<expression>,<condition>)```
2. Replace `<expression>` with required `[Column Name]` and `<condition>` equals `[Column Name]="Filter Condition"`
3. Replace **Column Name** with the actual name of your column and **Filter Condition** with the required condition to be applied on the columns.
4. To learn how to add calculated columns in Infoveave, visit the section [Calculated Columns](/studio-v8/datasources/calculated-columns-datasource/) under Sources.
</Steps>

<Aside type="caution">
Do not use double quotes when setting up a numeric as the filter condition.
</Aside>

<div class="elementor-alert" role="alert">
<span class="elementor-alert-title">Example</span>
<span class="elementor-alert-description">
If you have a dataset with sales data and you want to add a row number to each entry where the sales channel is "Online", you would use the ROWNUMBER function as follows <br/> 
```
ROWNUMBERX([Priority], [Saleschannel]="Online")
```
</span>
</div>


