Step 11: Defining a More Complex HTML Batch Job That Extracts Calculated Data |
In this step, you will produce an HTML report with a calculated column. For each scheduled tour, the report shows the number of places available and the number of places already booked. In each case, the total of places booked is the sum of the NUM_PART values of child records in table Reservation. To export calculated data:
The corresponding columns are placed on the output list of your statement.
Your statement now contains a join with table Reservation.
SUM(Reservation.NUM_PART)
Drag-and-drop the Destination, Type, Start Date, and Capacity columns from the Scheduled Tour table onto the Group by Definitions tab page at the bottom of the window. Enter sequence numbers 1,2,3,4 and 5 in the Position field on the Column Definitions tab page and numbers 1,2,3,4 in the Position in Group By field on the Group By Definitions tab page. Navigate between the SQL, Results, Column Definitions, and Group By Definitions tab pages until you are satisfied that you have produced the desired statement retrieving the desired results. One of the Island Suntanner tours to Australia is overbooked by 20 %. There is a business rule specifying that tours may be overbooked by a maximum of 20 % of places available.
Here is the SQL statement: SELECT "Scheduled Tour".DESTINATION , "Scheduled Tour".TOUR_TYPE , "Scheduled Tour".START_DATE , "Scheduled Tour".MAX_PART , SUM(Reservation.NUM_PART) FROM SCHEDTOUR "Scheduled Tour" , RESERVATION Reservation RELATE "Scheduled Tour" "FOR WHICH ARE MADE" Reservation GROUP BY "Scheduled Tour".DESTINATION , "Scheduled Tour".TOUR_TYPE , "Scheduled Tour".START_DATE , "Scheduled Tour".MAX_PART
External set elements are computed on the basis of the underlying SQL statement.
To define an export task and a job: The procedure is the same as in steps 6 and 9.
Next Step |