NOTE: This function has been superseded by the $sourcerownumber reference. While this function is still usable in the product, it is likely to be deprecated in a future release. Please use $sourcerownumber instead. For more information, see Source Metadata References.

Returns the row number of the current row as it appeared in the original source dataset before any steps had been applied.

The following transforms might make original row information invalid or otherwise unavailable. In these cases, the function returns null values:

NOTE: This function does not apply to relational database sources.

NOTE: If the dataset is sourced from multiple files, a predictable original source row number cannot be guaranteed, and null values are returned.

Tip: If the source row information is still available, you can hover over the left side of a row in the data grid to see the source row number in the original source data.

Example:


sourcerownumber()


Output: Returns the source row number for each row as it appeared in the original data.

Sort Example:


Output: Rows in the dataset are re-sorted according to the original order in the dataset.

Delete Example:


Output: Deletes the rows in the dataset that were after row #101 in the original source data.

There are no arguments for this function.

Example - Header from row that is not the first one

Example - Using sourcerownumber to create unique row identifiers

The following example demonstrates how to unpack nested data. As part of this example, the SOURCEROWNUMBER function is used as part of a method to create unique row identifiers.

Example - Delete rows based on source row numbers

Source:

Your dataset is the following set of orders.

CustIdFirstNameLastNameCityStateLastOrder
1001SkipJonesSan FranciscoCA25
1002AdamAllenOaklandCA1099
1003DavidWigginsOaklandMI125.25
1004AmandaGreenDetroitMI452.5
1005ColonelMustardLos AngelesCA950
1006PaulineHallSagninawMI432.22
1007SarahMillerCheyenneWY724.22
1008TeddySmithJuneauAK852.11
1009JoelleHigginsSacramentoCA100


Transformation:

Initially, you want to review your list of orders by last name.

During your review, you notice that two customer orders are no longer valid and need to be removed. They are:

You might hover over the left side of the screen to reveal the row numbers. You select the row numbers for each of these rows, and a delete suggestion is provided for you. When you click Modify, you see the following transformation:

The above checks the results of the sourcerownumber function, which returns the original row order for the selected rows. If a selected row matches values in the [2,7] array of row numbers, then the row is deleted.

Results:

When the preceding transform is added, your dataset looks like the following, and your sort order is maintained:

Source:

CustIdFirstNameLastNameCityStateLastOrder
1002AdamAllenOaklandCA1099
1004AmandaGreenDetroitMI452.5
1009JoelleHigginsSacramentoCA100
1007SarahMillerCheyenneWY724.22
1005ColonelMustardLos AngelesCA950
1008TeddySmithJuneauAK852.11
1003DavidWigginsOaklandMI125.25