Review Join Results in the Data Grid
After you have created a join on the canvas, review the data grid to make sure the join produces the results that you expect. If the data grid displays data that you don't expect, you might need to modify the join.
Results in the data grid
-
No data: If no data displays in the data grid, you might need to change the join type or a join field used in the join condition. If you suspect a mismatch between fields in the join, use a calculation instead. For more information, see Use calculations to resolve mismatches between fields in a join.
-
Duplicate data: If you see duplicate data, there a few things you can do. Consider relating the tables instead of joining. For more information, see Relate Your Data(Link opens in a new window).
-
Missing data: If some data is missing from the data grid, you might need to change the join type or a join field used in the join condition. Again, if you suspect a mismatch between fields in the join, use a calculation instead. For more information, see Use calculations to resolve mismatches between fields in a join.
-
Many null values: If you see many null values that you do not expect, you might need to change the join type from the full outer type to the inner type.
-
All null values for one table: If all values for one table is null, there are no matches between the tables that you are joining. If this is not expected, consider changing the join type.
Use calculations to resolve mismatches between fields in a join
When the fields in a join condition don't match—that is a mismatch between the values in the fields used in a join condition, the data grid can show little or no data at all. A mismatch between fields can occur for several reasons but often caused by the differences in format of the string values or date values in the fields. In many cases, you can resolve mismatches between the fields in your join by using a calculation.
Most functions are available for you to use in a calculation to create and replace a field in the join condition, with the exception of aggregate functions and table calculation functions.
Note:Join calculations are not supported for QuickBooks Online, Marketo, Oracle Eloqua, Anaplan, ServiceNow ITSM, and web data connectors.
String mismatch
A common mismatch scenario when working with string data occurs when one of the fields on one side of the join condition is equivalent to two or more fields on the other side of the join condition. In this case, you can use a calculation to combine the two fields so that its format matches the other field in the join condition.
For example, suppose you want to join two tables that contain the following data:
Patron | Contact | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
The common fields between the two tables appear to be name. However, in the Patron table the first and last names are in separate columns and in the Contact table the first and last names are in the same column. To join the tables on names, you can use a calculation in the left side of the join condition to merge the first name and last name columns together.
The result is a calculated field on the left side of the join condition that is accessible only from the join dialog. This calculation converts the field in the Patron table into a format that now matches the format of the field in the Contact table on the right side of the join condition.
Using the calculation in the join produces the following combined table:
First name | Last name | Branch | Member since | Units borrowed | Fees | Suggested limit | Name | Phone number |
---|---|---|---|---|---|---|---|---|
Alan | Wang | North | 2000 | 1 | 0 | 15 | Alan Wang | 555-0356 |
Fred | Suzuki | North | 2000 | 52 | .90 | 15 | Fred Suzuki | 555-0188 |
Date mismatch
A common mismatch scenario when working with date data occurs when the date values in one field of the join condition are captured at a different level of detail than the other field in the join condition. In this case you can use a calculation in the join condition to change the format of the field on one side of the join condition so that its format matches the other field in the join condition.
For example, suppose you have the following two tables of data:
Projector rental | Patron | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
To find out more information about new patron behavior, joining the Patron table to the Projector Rental table might provide some insight about which library services motivate new memberships. The common fields between the two tables appear to be "Date" and "Member since." However, the date values in each field are captured at different levels of detail. To join these tables on their respective date fields, use a combination of DATE functions in a calculation on each side of the join condition to make the level of detail in each field match.
|
DATE('01/01/'+STR([Member since]))
|
Using the calculation in the join produces the following combined table:
Date | Reservation type | Requester ID | ID | First name | Last name | Branch | Member since | Units borrowed | Fees | Suggested limit |
---|---|---|---|---|---|---|---|---|---|---|
1/1/2000 |
Individual | 233445589 | 232502870 | Alan | Wang |
North |
2000 | 1 | 0.00 | 15 |
1/1/2000 | Individual | 233445589 | 233445589 | Fred | Suzuki | North | 2000 | 52 | 0.90 | 15 |
1/1/2000 | Individual | 233445589 | 233445566 | Ashley | Garcia | South | 2000 | 243 | 11.30 | 15 |
1/1/2000 | Individual | 233445589 | 233448978 | John | Smith | North | 2000 | 36 | 3.50 | 15 |
To determine if a patron rented the projector in the same year he or she started his or her membership, add one more clause to the join based on ID.
The result of the additional join condition shows that only one patron might have started his membership to rent a projector.
Date | Reservation type | Requester ID | ID | First name | Last name | Branch | Joined | Units borrowed | Fees | Suggested limit |
---|---|---|---|---|---|---|---|---|---|---|
1/1/2000 | Individual | 233445589 | 233445589 | Fred | Suzuki | North | 2000 | 52 | 0.90 | 15 |