Overview
The Unique operator helps you remove duplicate values from your data set, leaving only distinct records. Doing so is especially useful when working with large data sources where repeated values can create confusion.
You'll find the Unique operator under the Table group to the left of the Data Workflow canvas.
About the Info Window
Here's a breakdown of each setting in the Info window:
Info | |
---|---|
Category | Grayed out and non-adjustable setting indicating the operation type. |
Label | Sets the label for your operator, displaying below the operator on your Data Workflow canvas. This field is optional, but set a label if you use more than one of the same operator type. A label helps you identify your operators without opening any Info windows. |
Preserve Argument Type | When selected, this setting ensures the argument data type is respected when the operator executes. |
Unique Keys | Tells the operator which data where to retrieve unique values. This key would be the name of the column of a data table. For example, if you have a column labeled country, you'd enter country here.
|
Adding a Unique Operator
In this example, you'll configure a Data Table component that stores a list of countries. In the Data Table component, you'll include a couple of duplicate entries and set up a Data Workflow to remove the duplicate entries.
These instructions assume you have a new module open and saved with a title.
Configure the Data Table Component
First, configure a Data Table component to store the list of countries. For this example, ensure to include duplicate entries to demonstrate how the Unique operator removes them.
In the Module Builder, drag and drop a Data Table component onto your canvas.
In the Property ID field, enter dtCountries.
In the data table, enter the following:
A
1
Countries
2
Afghanistan
3
Albania
4
Algeria
5
Cambodia
6
Czechia
7
Andorra
8
Austria
9
Afghanistan
10
Albania
11
Algeria
12
Afghanistan
Click Save Component.
Configure the Hidden Component
Next, you'll configure a Hidden component to store the output from the Data Workflow.
Drag and drop a Hidden component onto your canvas, placing it below your Data Table component.
In the Property ID and Label Text fields, enter
uniqueCountries
.Click Save Component.
Configure the Data Workflow Component
Configure a Data Workflow component to bring in the table data and remove the duplicate entries, returning only the distinct entries.
Drag and drop a Data Workflow onto your canvas, placing it between the
Data Table and Hidden components.
In the Property ID and Canvas Label Text fields, enter
dwfUnique
.Navigate to the Actions tab.
Set the Trigger Type to
Watch.
Configure the Input Operator
Drag and drop an Input operator onto your Data Workflow canvas.
Configure the operator's Info window as follows:
Info
Category
Input
Component
dtCountries
Required
Yes
Source
Default
Configure the Unique Operator
Drag and drop a Unique operator onto your Data Workflow canvas.
Configure the operator's Info window as follows:
Info
Category
Unique
Label
Show Unique Countries Only
Unique Keys
country
Connect the output port (right) of the dtCountries Input operator to the input port (left) of the Show Unique Countries Only Unique operator.
Configure the Output Operator
Drag and drop another Output operator onto your Data Workflow canvas.
Configure the operator's Info window as follows:
Info
Category
Output
Component
uniqueCountries
Action
value
Connect the output port (left) of the Show Unique Countries Only Unique operator to the input port (left) of the uniqueCountries Output operator.
Configure the Console Operator
Lastly, add a Console operator as an output to the Unique operator so you can review the results in the DevTools Console.
Drag and drop a Console operator onto your Data Workflow canvas.
Configure the operator's Info window as follows:
Info
Category
Console
Label
Unique Countries
Connect the output port (left) of the Show Unique Countries Only Unique operator to the input port (left) of the Unique Countries Console operator.
Click Save Component.
Save your module.
Here's how the completed example looks in the Module Builder:
Preview your module in Express View and open the DevTools Console. You'll see the Hidden component holding a list of countries, but each country displays only once.
Overview
The Unique operator helps you remove duplicate values from your data set, leaving only distinct records. Doing so is especially useful when working with large data sources where repeated values can create confusion.
You'll find the Unique operator under the Table group to the left of the Data Workflow canvas.
About the Info Window
Here's a breakdown of each setting in the Info window:
Setting | Description |
---|---|
Category | Grayed out and non-adjustable setting indicating the operation type. |
Label | Sets the label for your operator, displaying below the operator on your Data Workflow canvas. This field is optional, but set a label if you use more than one of the same operator type. A label helps you identify your operators without opening any Info windows. |
Preserve Argument Type | When selected, this setting ensures the argument data type is respected when the operator executes. |
Unique Keys | Tells the operator which data where to retrieve unique values. This key would be the name of the column of a data table. For example, if you have a column labeled country, you'd enter country here.
|
Adding a Unique Operator
In this example, you'll configure a Data Table component that stores a list of countries. In the Data Table component, you'll include a couple of duplicate entries and set up a Data Workflow to remove the duplicate entries.
These instructions assume you have a new module open and saved with a title.
Configure the Data Table Component
First, configure a Data Table component to store the list of countries. For this example, ensure to include duplicate entries to demonstrate how the Unique operator removes them.
In the Module Builder, drag and drop a Data Table component onto your canvas.
In the Label Text and Property ID, enter
dtCountries
.In the data table, enter the following:
A
1
Countries
2
Afghanistan
3
Albania
4
Algeria
5
Cambodia
6
Czechia
7
Andorra
8
Austria
9
Afghanistan
10
Albania
11
Algeria
12
Afghanistan
Click Save & Close.
Configure the Hidden Component
Next, you'll configure a Hidden component to store the output from the Data Workflow.
Drag and drop a Hidden component onto your canvas, placing it below your Data Table component.
In the Property ID and Canvas Label Text fields, enter
uniqueCountries
.Click Save & Close.
Configure the Data Workflow Component
Next, configure a Data Workflow component to remove the duplicate entries from the data table and return only the distinct entries.
Drag and drop a Data Workflow onto your canvas, placing it between the Data Table and Hidden components.
In the Canvas Label Text and Property ID fields, enter
dwfUnique
.Navigate to the Actions tab.
Set the Trigger Type to Watch.
Configure the Input Operator
Drag and drop an Input operator onto your Data Workflow canvas.
Configure the operator's Info window as follows:
Setting
Value
Category
Input
Component
dtCountries
Required
Yes
Source
Default
Configure the Unique Operator
Drag and drop a Unique operator onto your Data Workflow canvas.
Configure the operator's Info window as follows:
Setting
Value
Category
Unique
Label
Show Unique Countries Only
Unique Keys
country
Connect the output port (right) of the dtCountries Input operator to the input port (left) of the Show Unique Countries OnlyUnique operator.
Configure the Output Operator
Drag and drop another Output operator onto your Data Workflow canvas.
Configure the operator's Info window as follows:
Setting
Value
Category
Output
Component
uniqueCountries
Action
value
Connect the output port (left) of the Show Unique Countries Only Unique operator to the input port (left) of the uniqueCountries Output operator.
Configure the Console Operator
Lastly, add a Console operator as an output to the Unique operator so you can review the results in the DevTools Console.
Drag and drop a Console operator onto your Data Workflow canvas.
Configure the operator's Info window as follows:
Setting
Value
Category
Console
Label
Unique Countries
Connect the output port (left) of the Show Unique Countries Only Unique operator to the input port (left) of the Unique Countries Console operator.
Click Save.
Here's how the completed Data Workflow looks:
Save your module.
Below is the completed configuration in the Module Builder:
Preview your module in Express View and open the DevTools Console. You'll see the Hidden component storing a list of countries, but each country displays only once.