It is used to specify uniqueness of records retrieved.
In For Each command and Xfor Each command:
Option Distinct
In Data Provider object:
GroupName [Distinct]
This clause allows the For each command and Data Provider object to only return records where the set of values of the attributes referred to is unique.
The attributes that are included in the distinct clause are those referenced in the for each command, including: the attributes in the Where, Defined By and the attributes needed to navigate the extended table.
Suppose that we have defined the following For Each command:
For Each
Defined by InvoiceDate
option Distinct
&CustomerName = CustomerName
EndFor
which is equivalent to this Data Provider:
Customers
{
Customer [Distinct]
Defined by InvoiceDate
{
CustomerName
}
}
The result is a list of different Customer Names.
In For Each and XFor Each commands this clause can only be specified immediately after a For Each, Where, or Defined by command.
For Each command
Xfor Each command
Option Distinct clause