-
Notifications
You must be signed in to change notification settings - Fork 1
FilterOnce Operator
The FilterOnce
operator can be leveraged to filter out unique expressions from an input source.
What | Type |
---|---|
Syntax | FilterOnce(expression) |
expression |
string |
Return type | bool |
First, the expression
is evaluated to a string; the operator keeps a map of "seen" values and compares the expression string with what it already knows.
- Case a) The operator has not yet seen the value: In this case,
FilterOnce
returnstrue
, and stores the value for future reference - Case b) The operator has already seen the value. The operator returns
false
.
The FilterOnce
operator should only be used inside a <SourceFilter>
tag (see Config File Documentation).
Attention: Please note that this only filters for unique expressions; this does not mean that all other fields which you may or may not output in your field mapping also match among all records where the expression match. The values of the other fields you output will be taken from the record current in Case b) above. This means, it is not a 100% equivalent of SQLs SELECT DISTINCT
feature.
Examples:
Filter | Description |
---|---|
<SourceFilter>FilterOnce($LastName)</SourceFilter> |
Filters for unique $LastName values |
<SourceFilter>FilterOnce($FirstName + " " + $LastName</SourceFilter> |
Filters for unique full names |
See also FilterDuplicate Operator.