Sequence Generator | |||
Description | Sequence Generator adds a sequence column to your dataset. | ||
Why to use | To add Surrogate Keys, Primary Keys to the dataset. | ||
When to use | When you want to add a sequence column to your dataset. | When not to use | — |
Prerequisites | No prerequisites: it can be applied to any dataset. | ||
Input | Dataset of any type | Output | Dataset with additional sequence column |
Statistical Methods used | — | Limitations | — |
Sequence Generator is located under Model Studio ( ) in Data Preparation, in the task pane on the left. Use the drag-and-drop method (or double-click on the node) to use the algorithm in the canvas. Click the algorithm to view and select different properties for analysis.
Refer to Properties of Sequence Generator.
The Sequence Generator is used to add a sequence column to the dataset. It helps to add Surrogate Keys, Primary Keys to the data.
It gives you an option to define your sequence or use data from an existing database to create your sequence. The options are explained in the below sections.
Properties of Sequence Generator
The available properties of the Sequence Generator while using the Use database sequence option are as shown in the figure given below.
The table given below describes the different fields present on the Properties pane of the Sequence Generator.
Table 1: Description of Fields present on the Properties Pane of Sequence Generator - Use Database Sequence
Field | Description | Remark | |
Task Name | It is the name of the task selected on the workbook canvas. | You can click the text field to edit or modify the name of the task as required. | |
New column name | It allows you to specify the name of the Sequence Generator column. | — | |
Use database sequence | It is one of the options to specify the sequence generation method for your dataset. Select this option to use a sequence from an existing ODBC dataset. | — | |
Use the defined counter sequence | It is one of the options to specify the sequence generation method for your dataset. Select this option to define your counter sequence with the start value, increment value, and maximum value of the sequence. | For more details, refer to Defining Counter Sequence. | |
Select Dataset | It allows you to select a database to be used for sequence generation. |
| |
Enter Sequence Name | It allows you to specify the name of the sequence that is already defined in the selected dataset. | Available only if Use database sequence is selected. | |
Advanced | Node Configuration | It allows you to select the instance of the AWS server to provide control on the execution of a task in a workbook or workflow. | For more details, refer to Worker Node Configuration. |
Defining Counter Sequence
You can define your counter sequence to be used for sequence generation. There are three options to select the start value of the sequence.
The available properties of the Sequence Generator while using the Use the defined counter sequence option are as shown in the figure given below.
The table given below describes the different fields present on the Properties pane of the Sequence Generator for defining counter sequence.
Table: Description of Fields present on the Properties Pane of Sequence Generator – Use the Defined Counter Sequence
Field | Description | Remark | |
Select Start Value Option | It allows you to select the option for the start value of the sequence. | The available options are –
| |
Start | It allows you to set the starting value of the sequence. |
| |
Maximum | It allows you to set the maximum value of the sequence. | Available only if Use the defined counter sequence is selected. | |
Increment By | It allows you to select the increment value for the sequence generator | Available only if Use the defined counter sequence is selected. | |
Current Value | This option is disabled currently. | — | |
Select Dataset | It allows you to select a database to be used for sequence generation. | You can use any dataset available in the current project. | |
Select Column | It allows you to select a column from the selected dataset. This column is used for sequence generation. |
| |
Advanced | Node Configuration | It allows you to select the instance of the AWS server to provide control on the execution of a task in a workbook or workflow. | For more details, refer to Worker Node Configuration. |
Example of Sequence Generator
Consider a Sales dataset of different Items, their Unit Cost, Number of Units, and Total Price. A snippet of input data is shown in the figure given below.
The properties selected are –
Property | Value |
Sequence generator option | Use the defined counter sequence |
Start Value | 1 |
Increment By | 1 |
The result of the Sequence Generator is displayed in the figure below.
As seen in the above figure, a new column MySequence is added to the dataset.
The start value of the sequence is one, and for each row, the value is incremented by one.
Table of Contents