Tasks > Masking tasks > Data subset use cases for two objects
  

Data subset use cases for two objects

When you define a filter for an object in a task, the task selects a default path so that it can traverse through the entire graph at least once.
For every selected record, the task loads all the parent records to maintain referential integrity. You can configure relationship behavior to select child records from an object.
Consider that there are two objects Account and Contact. Account is the parent object, and Contact is the child object of Account. You can apply filter on the Account object or the Contact object. You can either use the default path that the task selects or configure the path. The number of paths traversed is minimal with the default path selection.
The number of subset rows is not the sum of all target rows that the task loads. The subset estimates show the number of unique records that are selected from all the relationships and loaded to target.

Case 1. Select the default path with filter on Account

Consider that you apply a filter on the Account object with the condition that the account name starts with the letter A.
The following image shows the data subset filter criteria that you can configure:
The image shows that the data subset filter is applied on the Account object with the account names that start with the letter A. The number of join operations is 2.
The task traverses the default path from Account to Contact through the relationship Account. The number of join operations to compute the subset with the default path selection is two.
The following image shows the graphical representation of the relationship between Account and Contact objects:
The image shows the graphical representation of the relationships between Account and Contact objects. The path from Account to Contact through the relationship Account is selected.
The task first loads the records from the Account object on which the filter is applied. Then the task traverses through the default path from Account to Contact through the relationship Account and loads the records. To maintain referential integrity, the task traverses from Contact to Account through the relationship ParentAccount__r.
The following image shows the sequence in which the task selects the records:
The image shows the selection sequence for the Account and Contact objects with the filter on the Account object.
Based on the filter applied, the Account object has four rows. From Account to Contact, the Contact object has five rows through the relationship Account. From Contact to Account, the Account object has three rows through the relationship ParentAccount__r.
To view the number of subset rows, you estimate the subset. If there are common records from multiple join operations, the task updates the records. If there are new records, the task adds the subset rows. In this use case, though the Account object shows total seven rows, the task loads four subset rows that are unique for the Account object from all the relationships. The task loads five subset rows for the Contact object.
The following image shows the subset statistics that you can estimate in a task:
The image shows the subset statistics for the Account and Contact objects.

Case 2. Select the configured path with filter on Account

Consider that you apply a filter on the Account object with the condition that the account name starts with the letter A.
The following image shows the data subset filter criteria that you can configure:
The image shows that the data subset filter is applied on the Account object with the account names that start with the letter A. The number of join operations is 4.
Consider that you choose both the relationships Account and ParentAccount__r between Account and Contact objects. The number of join operations to compute the subset with the configured path is four.
The following image shows the graphical representation of the relationship between Account and Contact objects:
The image shows the graphical representation of the relationships between Account and Contact objects. The path from Account to Contact through the relationship Account and the path from Contact to Account through the relationship ParentAccount__r are selected.
The task first loads the records from the Account object on which the filter is applied. Then the task traverses through the selected paths from Account to Contact through both the relationships Account and ParentAccount__r. To maintain referential integrity, the task traverses from Contact to Account through both the relationships Account and ParentAccount__r.
The following image shows the selection sequence of the objects:
The image shows the selection sequence for the Account and Contact objects with the filter on the Account object.
Based on the filter applied, the Account object has five rows. From Account to Contact, the Contact object has ten rows with both the relationships Account and ParentAccount__r. From Contact to Account, the Account object has seven rows with the relationships Account and ParentAccount__r.
To view the number of subset rows, you estimate the subset. If there are common records from multiple join operations, the task updates the records. If there are new records, the task adds the subset rows. In this use case, though the Account object shows total 12 rows, the task loads five subset rows that are unique for the Account object from both the relationships. Though the Contact object shows total 10 rows, the task loads seven subset rows that are unique for the Contact object from both the relationships.
The following image shows the subset statistics that you can estimate in a task:
The image shows the subset statistics for the Account and Contact objects.

Case 3. Select the default path with filter on Contact

Consider that you apply a filter on the Contact object with the condition that the first names start with the letter A.
The following image shows the data subset filter criteria that you can configure:
The image shows that the data subset filter is applied on the Contact object with the first names that start with the letter A. The number of join operations is 2.
Since the Account object is parent to the Contact object and the filter is applied on the Contact object, the task does not select a relationship for child record selection. To maintain referential integrity, the task traverses from Contact to Account through both the relationships Account and ParentAccount__r. The number of join operations to compute the subset with the default path selection is two.
The following image shows the graphical representation of the relationship between Account and Contact objects:
The image shows the graphical representation of the relationships between Account and Contact objects.
The task first loads the records from the Contact object on which the filter is applied. Then the task traverses through the paths from Contact to Account through the relationships Account and ParentAccount__r, and loads the records.
The following image shows the sequence in which the task selects the records:
The image shows the selection sequence for the Account and Contact objects with the filter on the Contact object.
Based on the filter applied, the Contact object has 12 rows. From Contact to Account, the Account object has 13 rows through the relationships Account and ParentAccount__r.
To view the number of subset rows, you estimate the subset. If there are common records from multiple join operations, the task updates the records. In this use case, though the Account object shows total 13 rows, the task loads 12 subset rows that are unique for the Account object from all the relationships. The task loads 12 subset rows for the Contact object.
The following image shows the subset statistics that you can estimate in a task:
The image shows the subset statistics for the Account and Contact objects.

Case 4. Select the configured path with filter on Contact

Consider that you apply a filter on the Contact object with the condition that the first names start with the letter A.
The following image shows the data subset filter criteria that you can configure:
The image shows that the data subset filter is applied on the Contact object with the first names that start with the letter A. The number of join operations is 6.
Consider that you choose both the relationships Account and ParentAccount__r between Account and Contact objects. The number of join operations to compute the subset with the configured path selection is six.
The following image shows the graphical representation of the relationship between Account and Contact objects:
The image shows the graphical representation of the relationships between Account and Contact objects. The path from Account to Contact through the relationship Account and the path from Contact to Account through the relationship ParentAccount__r are selected.
The task first loads the records from the Contact object on which the filter is applied. To maintain the referential integrity, the task traverses from Contact to Account through both the relationships Account and ParentAccount__r. Then the task traverses from Account to Contact through the configured paths for child records selection with the relationships Account and ParentAccount__r and loads additional records. To maintain referential integrity for the additional records, the task traverses from Contact to Account through both the relationships Account and ParentAccount__r.
The following image shows the sequence in which the task selects the records:
The image shows the selection sequence for the Account and Contact objects with the filter on the Contact object.
Based on the filter applied, the Contact object has 15 rows. From Contact to Account, the Account object has 13 rows through both the relationships Account and ParentAccount__r. From Account to Contact, the Contact object has 16 rows through both the relationships Account and ParentAccount__r. From Contact to Account, the Account object has 17 rows through the relationships Account and ParentAccount__r.
To view the number of subset rows, you estimate the subset. If there are common records from multiple join operations, the task updates the records. In this use case, though the Account object shows total 30 rows, the task loads 14 subset rows that are unique for the Account object from both the relationships. Though the Contact object shows total 31 rows, the task loads 15 subset rows that are unique for the Contact object from both the relationships.
The following image shows the subset statistics that you can estimate in a task:
The image shows the subset statistics for the Account and Contact objects.