--- title: "DiscreteIntegerSequence" slug: "discreteintegersequence" updated: 2022-09-26T10:07:26Z published: 2022-09-26T10:07:26Z canonical: "docs.datajet.app/discreteintegersequence" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # DiscreteIntegerSequence ## General: DiscreteIntegerSequence ### Produces a field that is the record number in a table, stored as a discrete integer ## Purpose Use this function to: - Create a unique primary key on an existing table of less than 1 million rows - Identify and select specific records by row number - Create a record key for use in preparing source data for modelling ## Return Value | Property | Value | | --- | --- | | **FieldType** | Integer | | **FieldSize** | Low / Med / High | | **DataType** | Discrete | | **DataSize** | Integer | ```shell Example Return Value: 1.....N where N = number of records in the table. ``` ![DiscreteIntegerSequence_Sample](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DiscreteIntegerSequence_Sample.PNG) ## Parameters | Parameter | JSON | Description | | --- | --- | --- | | **Table** | “targetTable”: “MyTableName” | The target table on which the new field will be created | | **Filter** | “dataset”: {DataSet_JSON} | Optional. If a filter is applied, records not in the filter recordset will be returned as null. | | **Function** | "function":"DiscreteIntegerSequence" | DiscreteIntegerSequence | ## JSON Sample ```json { "method": "BuildBakedField", "project": "Model1", "targetTable": "worldcities", "overwrite": true, "name": "KeyField", "function": "discreteintegersequence" } ``` ## Usage Notes See Also: - Engineering | Expression Field - [LongSequenceKey (General Functions)](https://datajet.document360.io/v1/docs/longsequencekey) - [IntegerSequenceKey (General Functions)](/v1/docs/integersequencekey) - [MakeContinuousKey (General Functions)](https://datajet.document360.io/v1/docs/makecontinuouskey) ## Example | Example | Details | | --- | --- | | **Description** | Create a discrete key field to give each worldcity an ID | | **Input** | - Table: = [worldcities] - Filter: = [No Filter] - **Function: = DiscreteIntegerSequence** - Name: =KeyField | | **Sample** | ![DiscreteIntegerSequence_Example](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DiscreteIntegerSequence_Example.PNG) |