Previous Next

Task 3:  Build a data set

In this procedure, you build a data set to indicate what data to extract from the Customers, OrderDetails, and Products tables.

1  
2  
Sales
3  
4  
SELECT Customers.state,
Orderdetails.quantityOrdered,
Orderdetails.priceEach,
Products.productline
 
FROM Customers INNER JOIN Orders ON Customers.customerNumber = Orders.customerNumber
INNER JOIN Orderdetails ON Orders.orderNumber = Orderdetails.orderNumber
INNER JOIN Products ON Orderdetails.productCode = Products.productCode
 
WHERE Customers.country = 'USA'
This SELECT statement joins four tables to get the required data.
5  
6  
7  
1  
EXTENDED_PRICE
2  
3  
row["QUANTITYORDERED"] * row["PRICEEACH"]
Alternatively, open the expression builder to construct the expression by selecting the appropriate data set fields. Note that data set field names are case-sensitive. If you typed row["quantityOrdered"] in the Expression field, BIRT displays an error when you preview the results returned by the data set. The case requirement for data set field names is unlike the SELECT statement where you can type table field names in any case.

Figure 16-2 Computed field EXTENDED_PRICE

Figure 16-2  Computed field EXTENDED_PRICE
4  
8  

Figure 16-3 Preview of rows returned by the Sales data set

Figure 16-3  Preview of rows returned by the Sales data set
9  

(c) Copyright Actuate Corporation 2013