Joining information objects
Joining information objects is similar to joining tables in a database. As in a table join, you join information objects through a common field. For example, suppose one information object retrieves customer data, such as name, customer ID, address, phone, and credit limit. Another information object retrieves order data, such as order number, order date, ship date, status, and customer ID. Both information objects include a customer ID field, which you use to join the information objects.
You can retrieve data from any number of information objects as long as there is a relationship, identified by common fields, among the information objects. Figure 3‑1 shows three information objects and the fields that join them. The Customer IO is joined to the Orders IO through the customerNumber field, and the Orders IO is joined to the OrderDetails IO through the orderNumber field.
Figure 3‑1 Joining information objects through common fields
How to join information objects
This procedure assumes you have created a new BIRT design and selected an information object data source.
1 In Available Data, choose Modify, as shown in Figure 3‑2. This figure also shows an example of Available Data displaying the data fields in the first information object, Customers.
Figure 3‑2 Choosing Modify in Available Data
Join displays the information object, Customers, under List of Information Objects, as shown in Figure 3‑3.
Figure 3‑3 Join displaying the current information object used in the BIRT design
2 Select a second information object to join to the first information object:
1 Choose Add Objects.
2 On Select Information Object, browse through the folders to find and select an information object. Figure 3‑4 shows an example of Select Information Object displaying the contents of a folder, which includes two information objects.
Figure 3‑4 Select Information Object displaying the contents of a folder
3 Choose OK. The second information object appears in List of Information Objects on Join.
3 Join the information objects:
1 On Join, in Select Join, choose Add Join. Add Join displays two fields, Left and Right, which contain the names of the information objects.
2 In Left, select one information object. Then, in Right, select the other information object. Figure 3‑5 shows an example where CustomerData and OrderData are selected in the Left and Right fields, respectively.
Figure 3‑5 Using Add Join to select two information objects to join
3 Choose OK. Select Join displays the information objects selected for the join, as shown in Figure 3‑6.
Figure 3‑6 Examining the information objects selected for the join
4 Specify the join condition:
1 In Join, in Join Conditions, choose Add Condition.
Add Join Condition lists all the fields in the first and second information objects.
2 In Left, select a field. In Right, select a field that contains the same data. The two fields do not have to have identical names, but they must have the same data type.
3 In Condition, select a comparison operator. Typically, you use the default operator, equal to. Figure 3‑7 shows an example of a completed join condition. The join condition joins the information objects on their respective customerNumber fields. This condition retrieves only those rows in which the customerNumber values match.
Figure 3‑7 Adding a join condition
4 Choose OK. Join Conditions displays the specified join condition, as shown in Figure 3‑8.
Figure 3‑8 Examining the completed join
You have finished joining two information objects.
5 Repeat the previous steps to add and join additional information objects. Choose OK when you finish joining the information objects.
Available Data displays all the data fields from the joined information objects that you can insert in a table in your BIRT design. In Figure 3‑9, Available Data shows the data fields in two information objects, CustomerData and OrderData.
Figure 3‑9 Examining the fields of two joined information objects