Duco allows users to create their own custom rules in a several places. These are expressed in Natural Rule Language (NRL), an easy to read English-like rule building language. Places where NRL rules can be applied include:
- The Match fields screen, to apply data manipulation or to combine input fields.
- The Rules & Rule sets screen, to create conditions that determine if a rule set is applied or not.
- The Filter rules screen, to select which records a matching process should exclude.
- The Workflow rules screen, to construct rules that assist you with working your exceptions.
A rule is constructed in the same way regardless of where it is used. The only difference among the three usage cases in the list above is that, in the Rules & Rule sets and in the Filter rules screens, the type of rules that can be created must be of ones that return a true or false type result. In the Match fields screen, however, a rule can have a non-binary result, for example transforming the data.
Example
Watch this video for an introduction to Natural Rule Language
For example, here is a simple NRL rule being used for a filter:
This example assumes that the input data contains a field called "Currency" and that the "Currency" field contains values like "GBP", "USD", "EUR", etc. This rule imposes that in a record the value of the field Currency must be equal to "GBP". The rule gives as result "true" if the field value is indeed "GBP" and "false" otherwise.
You can, for example, use a rule like this in the Filter rules screen to exclude from a process all records where the currency is "GBP". Or in the Rules & Rule sets screen to apply a rule set only to records where the currency is "GBP". You can also use this rule in the Match fields screen as part of a more complex rule. For example of the form "If Currency is equal to "GBP" then ...".
A rule is constructed using drop down-menus. A placeholder like the following represents an "empty rule".
- Click on the drop-down menu. You'll see the various constructs that a rule can use. In this case choose "Something is equal to something".
Duco will then show the following:
- Click on the drop-down menu on the left and select "A field".
- Select a field, this example Currency.
Duco will then show the following:
- Click on the drop down menu and select "Some text"
- Type "GBP" (without quotes) in the text box and press enter.
- Duco will then show the finished rule:
A more complex example
Navigating through the drop-down menus, you can create fairly complex rules. Here is an example of a more complex rule that builds on the simple rule that the previous section describes. This is the rule that we want to create:
This example assumes that the input data contains a field called currency "Currency" that contains values like "GBP", "USD", "EUR", etc. and a field called "Notional" that contains values like "10000000", "20000000", etc.
Here is the rule that the previous section describes:
- Click on "Add and". This adds the standard logic "and" to the existing rule.
Duco will show the following:
- As previously, click on the drop-down menu and select "Something is greater than something"
Duco will show the following:
- Click on the drop-down menu on the left and choose "A field"
- ... then choose "Notional"
Duco will show the following:
- Click on the drop-down menu on the right and choose "A number"
- Enter 10000000 in the next box and press enter
Duco will then show the finished rule:
Rule constructs
Duco supports many rule constructs, which the tables in this section describe. Don't be surprised if you can't see all the constructs all the times in the drop-down menus. The drop-down menus that you use to form the rules show only the constructs that are valid in a particular context.
The constructs in the following table are available in the Match fields screen. You can use them to add data manipulation to a simple one-to-one field mapping. A rule is also always necessary when you need to combine two or more fields.
Rule construct
|
Description
|
---|---|
If something then something |
Use it to construct rules of the form: If BuySellIindicator is equal to "Sell" set to Party1 ...optionally you can add the "else" part If BuySellindicator is equal to "Sell" set to Party1 else set to Party2 |
Set to something |
Use it to set to a value Set to Party1 |
The constructs in all of the the following tables are available for all rules in the Match fields, Rules & rules set and Filter rules screen.
Rule construct
|
Description
|
---|---|
Something is equal to something |
Use it to construct rules like: Currency is equal to "GBP" |
Something is not equal to something |
Use it to construct rules like: Currency is not equal to "GBP" |
Something is less than something |
Use it to construct rules like: Amount is less than 10000000 |
Something greater than something |
Use it to construct rules like: Amount is greater than 10000000 |
Something less than or equal to something |
Use it to construct rules like: Amount is less than or equal to 10000000 |
Something greater than or equal to something |
Use it to construct rules like: Amount is greater than or equal to 10000000 |
Something is one of something |
Use it to construct rules like: Currency is one of "USD", "EUR", "GBP" |
Something is not one of something |
Use it to construct rules like: Currency is not one of "USD", "EUR", "GBP" |
Something and something |
Use it to construct rules like: Amount is less than 10000000 and Currency is equal to "GBP" |
Something or something |
Use it to construct rules like: Amount is greater than 10000000 or Amount is less than to 50000000 |
Rule construct
|
Description
|
---|---|
A field | Choose this option when you want to select a field from the input data set. |
Some text | Choose this option when you want to enter some literal text directly in the rule. |
A number | Choose this option when you want to enter some a number directly in the rule. |
A date | Choose this option when you want to enter a date directly in the rule. E.g.: 2013-06-27. |
A time | Choose this option when you want to enter a time directly in the rule. E.g.: 09:30:00. |
A date and time | Choose this option when you want to enter a date and a time directly in the rule. E.g.: 2013-06-27T09:30:00. |
True or false | Choose this option when you want to enter boolean true/false value directly in the rule. |
File Name | Choose this option when you want to extract a value from a file name to match on, such as a date. |
Numbers
Rule construct
|
Description
|
---|---|
The absolute value of something |
Remove the sign of a number. E.g.: Set to the absolute value of Price "-3" → "3" "+3" → "3" |
First number embedded in something |
Assume a field called "Amount" contains a value like "GBP 10000000 incl. tax". You can extract numeric portion of this value with this rule: First number embedded in Amount The result is the numeric portion of the field. I.e., "10000000" |
A field as a number |
Treat a text field as a number. For example a field called "Price" may contain a monetary amount (e.g. 145.18), but also something like "N/A". The field must therefore be defined as a text field in the data inputs screen. If Price is not equal to "N/A" set to Price as a number * 100 |
Reference Data
Rule construct
|
Description
|
---|---|
A value from reference data | Looks up a value from a reference data. See the Reference Data section for more details. |
A particular entry exists in reference data | Checks whether an entry exists in a reference data table. See the Reference Data section for more details. |
Something with words replaced using table field and table field from table table
|
Translates a portion of a field value using a translation table. E.g.: Set to Counterparty with words replaced using company type abbreviation and company type from table company abbreviations For example:
This type of rule is useful to deal with common abbreviations and alternative spellings like "IBM" and "I.B.M.", "LLP" and "Limited liability partnership", etc. |
Arithmetic
Rule construct
|
Description
|
---|---|
Something + something |
Simple addition E.g.: Net amount + Commission amount |
Something - something |
Simple subtraction E.g.: Gross amount - Commission amount |
Something * something |
Simple multiplication E.g.: Share price * quantity |
Something / something |
Simple division E.g.: Trade amount / quantity |
Text manipulation
Rule construct
|
Description
|
---|---|
A field starts with some text |
Returns "true" if the specified field starts with the given text, otherwise return "false". For example: Amount starts with "GBP" |
A field does not starts with some text |
The opposite of the previous rule. Returns "true" if the specified field does not start with the given text, otherwise return "false". For example: Amount does not starts with "GBP" |
A field ends with some text |
Returns "true" if the specified field ends with the given text, otherwise return "false". For example: Buyer Company ends with "Ltd" |
A field does not end with some text |
Returns "true" if the specified field starts with the given text, otherwise return "false". For example: Buyer Company does not end with "Ltd" |
Something contains some text |
Returns "true" if the specified field contains the given text, otherwise return "false". Assume for example that a field called "Product type" has a value like "Swap/Vanilla/GBP/10000000/6M". You can check whether "GBP" is contained or not somewhere in this field with this rule: Product type contains "GBP" |
Something contains one of a list of values |
Returns "true" if the specified field contains at least one of the given texts, otherwise return "false". Assume for example that a field called "Product type" has a value like "Swap/Vanilla/GBP/10000000/6M". You can check whether the text "GBP" or "USD" is contained or not somewhere in this field with this rule: Product type contains "GBP", "USD" |
A field does not contain some text |
Returns "true" if the specified field does not contain the given text, otherwise return "false". Assume for example that a field called "Product type" has a value like "Swap/Vanilla/GBP/10000000/6M". You can check whether the word "GBP" is contained or not somewhere in this field with this rule: Product type does not contain "GBP" |
Something starts with one of a list of values |
Returns "true" if the specified field starts with any of the given texts, otherwise return "false". Assume for example that a field called "Product type" has a value like "Swap/Vanilla/GBP/10000000/6M". You can check whether the word "Swap" or "Option" is contained or not somewhere in this field with this rule: Product type starts with one of "Swap", "Option" |
Something does not starts with any of a list of values |
Returns "true" if the specified field does not start with any of the given texts, otherwise return "false". Assume for example that a field contains an IBAN. E.g., IT60X0542811101000000123456, DE89370400440532013000, GB29NWBK60161331926819, etc. You can check that an IBAN is not Italian or German with the following rule: IBAN does not start with any of "IT", "DE" |
Something ends with one of a list of values |
Returns "true" if the specified field ends with one the given texts, otherwise return "false". Assume for example that a field called "Product type" has a value like "Swap/Vanilla/GBP/10000000/6M". You can check whether the field value ends with "3M" or 6M" with this rule: Product type ends with one of "3M", "6M" |
Something does not starts with any of a list of values |
Returns "true" if the specified field does not end with any of the given texts, otherwise return "false". Assume for example that a field called "Product type" has a value like "Swap/Vanilla/GBP/10000000/6M", "Swap/Vanilla/USD/30000000/1Y". You can check that the field value ends with "3M" or 6M" with this rule: Product type does not starts with any of "3M", "6M" |
Text portion of a field from position to position |
Assume a field called "Account number" contains a value like "ABC001237X", "DTX010325T", etc. I.e. a three-character prefix, followed by a six-digit account number, followed by a one-character suffix. You can extract the account number with with this rule: Text portion of Account number between 4 and 9 The result will be "001237", "010325", etc. |
Text portion of something between something and something |
Assume a field called "Product type" contains a value like "Swap/Vanilla/GBP". You can extract the middle section of this value with with this rule: Text portion of Product type between "Swap/" and "/GBP" The result is the text after "Swap/" and before "/GBP". I.e., "Vanilla" |
Text portion of something before something |
Assume a field called "Product type" contains a value like "Vanilla/Swap". You can extract the first section of this value with this rule: Text portion of Product type before "/Swap" The result is the text before "/Swap". I.e., "Vanilla" |
Text portion of something after something |
Assume a field called "Product type" contains a value like "Swap/Vanilla". You can extract the second section of this value with this rule: Text portion of Product type after "Swap/" The result is the text after "Swap/". I.e., "Vanilla" |
Text portion of something matching the pattern some pattern
|
Use this to use regex to pattern detect a portion of a sting. Example: you have a text field where there is a numeric string, but its position or length varies so you can't use "set to text portion from position to position" or "between something and something". In this case, set to text portion matching pattern \d* will do the trick and it will extract the numeric part of the string from examples below: text 567 text |
First something characters of something |
Assume a field called "Amount" contains a value like "GBP 10000000". You can extract the currency portion of this value with this rule: First 3 characters of Amount The result is the currency portion of the field. I.e., "GBP" |
Last something characters of something |
Assume a field called "Amount" contains a value like "10000000 GBP". You can extract the currency portion of this value with this rule: Last 3 characters of Amount The result is the currency portion of the field. I.e., "GBP" |
A field with all of the leading characters in a set of characters removed |
Assume a field called "Price" contains values like "0197.34GBP", "0004.23GBP", "1874.46GBP". I.e., the values is left-padded with zeros. You can remove the leading zeros with this rule: The field Price with any leading "0" removed The result is the field value removed of leading zeros. I.e. "197.34GBP", "4.23GBP", "1874.46GBP". You can strip multiple characters. For example a rule like... The field Price with any leading "X0_" removed ... strips any leading "X", "0", or "_" (underscore) from the field value. |
Length of a field |
Gives the length of the value of a field. The length of Customer name E.g., If the value is "HSBC" the result is 4. If the value is "ABC trading ltd" the result is 15. |
Date and time
Rule construct
|
Description
|
---|---|
Date in a field in the format some format |
Treats a text field as a date. E.g.: The date in Payment Date in format “yyyy-MM-dd” Imagine, for example, that a field called "Payment Date" contains values like "2013-06-18", "N/A", "2013-06-19", etc. Duco will recognize this as a text field because it contains both dates and non-date fields. If you want to process only the dates, you can first filter out the non-date fields (you can use a filter rule) and then instruct Duco to process the remaining values as a date of a given format. |
Time in a field in the format some format |
Treats a text field as a time. E.g.: The date in Execution time in format “hh:mm” This rule is analogous to the the rule "Date in a field in the format some format". |
Date/time in a field in the format some format |
Treats a text field as a date/time. E.g.: The date in Execution date and time in format “yyyy-MM-dd hh:mm” This rule is analogous to the the rule "Date in a field in the format some format". |
Date portion of a field |
Extracts the date portion of a date-time field. E.g.: The date portion of Trade Date and Time Where the field "Trade Date and Time" is a value like "2013-07-09T11:37:00", the rule returns only the date. I.e.: "2013-07-09". |
Time portion of a field |
Extracts the time portion of a date-time field. E.g.: The time portion of Trade Date and Time Where the field "Trade Date and Time" is a value like "2013-07-09T11:37:00", the rule returns only the time. I.e.: "11:37:00" |
Date/time in something +/- number of days |
Adds or remove a certain number of days from a date/time field. The date/time in Trade Date and Time + 10 days If the value of the field "Trade Date and Time" is "2013-07-09T11:37:00", the rule returns "2013-07-19T11:37:00" |
Date in something +/- number of days |
Adds or removes a certain number of days from a date field. The date/time in Trade Date + 10 days If the value of the field "Trade Date" is "2013-07-09", the rule returns "2013-07-19" |
Runtime
Rule construct
|
Description
|
---|---|
the start date and time of the run |
Returns the start date and time of the run. This is typically used in an if-then type of rule. For example in a filter rule: Payment Date is less than the start date and time of the run Note that the date is given in UTC standard. |
File Name
Rule construct
|
Description
|
---|---|
submitted file name |
Returns the name of the most recently submitted file. Use it to construct rules like: Set to the date in the submitted file name in format YYYY-MM-dd |
file name in zip |
Returns the name of the most recently submitted file within a zipped submission. Use it to construct rules like: |
Financial identifiers
Duco supports checks on several types of identifiers in common use in the financial services industry.
Rule construct
|
Description
|
---|---|
A field is a valid ISIN |
Is true if a particular field contains a valid ISIN code. The following validations are applied:
The first two letters are not currently checked against the ISO country code list to ensure that they are a valid country. Example: "US0378331005" is a valid ISIN (Apple Computers) |
A field is not a valid ISIN | The opposite of the above |
A field is a valid Sedol |
Is true if a field contains a valid Sedol code. Both numeric and alpha-numeric Sedols are supported, but
Example: "0263494" is a valid Sedol (BAE Systems). "263494" is not valid, as it is not seven letters long (the leading zero is mandatory). |
A field is not a valid Sedol | The opposite of the above |
A field is a valid CUSIP |
Is true if a particular field contains a valid CUSIP code. Applies the following checks:
Example: "037833100" is a valid CUSIP. "037833105" is not valid, the checksum digit is wrong. |
A field is not a valid CUSIP | The opposite of the above |
Workflow rules
When configuring Workflow rules the following operators are selectable.
Rule Construct
|
Description
|
---|---|
Allocate the exception to group and assign it to user |
Use it to construct rules like: Allocate the exception to London Operations and assign it to Alice Cube |
Allocate the exception to group |
Use it to construct rules like: Allocate the exception to London Operations |
Set the exception’s status to status |
Use it to construct rules like: Set the exception's status to Closed |
Label the exception with labels |
Use it to construct rules like: Label the exception with Critical |
Remove labels from the exception |
Use it to construct rules like: Remove Outstanding from the exception |
Set the ageing start date and time of the exception to a date and time |
Use it to construct rules like: Set the ageing start date and time of the exception 10/09/2018 9:00 |
Rule Construct
|
Description
|
---|---|
The exception’s status is status |
Use it to construct rules like: If the exceptions status is Pending then remove Critical from the exception |
The exception’s status is not status |
Use it to construct rules like: If the exceptions status is not Pending then label the exception as Manager Review Outstanding |
The exception’s match status is status |
Use it to construct rules like: If the exceptions match status is Unmatched then label the exception as Submission difference |
The exception’s match status is not status |
Use it to construct rules like: If the exceptions match status is not Partial Match Allocate the exception to Singapore Operations and assign it to David Cube |
Exception is labelled with any of labels |
Use it to construct rules like: If the exceptions is labelled Critical then Allocate the exception to Management and assign it to Alice Cube |
Exception is not labelled with any of labels |
Use it to construct rules like: If the exceptions is not labelled EMEA then Allocate the exception to North America Team |
There is a break on fields |
Use it to construct rules like: If there is a break on Notional Allocate the exception to London Operations and assign it to Alice Cube |
There is no break on fields |
Use it to construct rules like: If there is no break on Price Label the exception with Moderate |
Exception is assigned to any of users |
Use it to construct rules like: If the Exception is assigned to David Cube Set the ageing start date and time of the exception 10/09/2018 9:00 |
Exception is not assigned to any of users |
Use it to construct rules like: If the Exception is not assigned to Jane Smith Label the exception with Requires review |
Exception is allocated to any of groups |
Use it to construct rules like: If the Exception is assigned to Tokyo Operations Set the ageing start date and time of the exception 10/09/2018 8:00 |
Exceptions is not allocated to any of groups |
Use it to construct rules like: If the Exception is not assigned to APAC Back Office Label the exception with EMEA |
Multiple rule sets
Duco enables you to create multiple rule sets. There are a few reasons to use multiple rule sets. Mainly:
- To organise your rules in distinct logical groups.
- To apply a set of rules to some records, but not to all records. You can associate a condition to a rule set to achieve this.
- To set up a multi-pass process you want to apply different rule sets to different passes.
See the page Conditional rule sets for a detailed description of multiple rule sets. See the page Multi-pass for a description of rule sets in the context of multi-pass matching.