Previous Topic: Step 1 - Specify your group levelNext Topic: Step 3 - Display your report


Step 2 - Specify your subtotal

Group by displays EMPLOYEE.DEPT-ID as the current group field. Level# displays 1 as the current group level. Use Avg to specify that you want CA OLQ to compute the average salary for each department.

CA OLQ Release nn.n *** Report Format - Group By *** -> Page 1 OF 1 136000 Specify summary computations and press the ENTER key Group by: EMPLOYEE.DEPT-ID Level# 1 Seq Sum Avg Max Min Count _ EMPLOYEE X EMP-LAST-NAME 4 _ _ _ _ X DEPT-ID 1 _ _ _ _ X SALARY AMOUNT 3 _ x _ _ X PROJECT 2 _ _ _ _ Skip lines after group 1 Separator character - Compute: 1=HELP 3=QUIT 4=MESSAGE 5=DISPLAY 6=MENU 10=PICTURE

CA OLQ generates this COMPUTE statement to calculate the average salary for each department.

CA OLQ Release nn.n *** Report Format - Sort *** -> Page 1 of 1 133000 Specify sort or group by request and press the ENTER key Disp Sort Order Group By Seq Priority (A/D) Level # EMPLOYEE X EMP-LAST-NAME 4 _ _ _ X DEPT-ID 1 1 A 1 X SALARY-AMOUNT 3 3 A _ X PROJECT 2 2 A _ COMPUTE FIELDS: X 'EMPLOYEE.SALARY-AMOUNT-AVE-2'=AVE(E MPLOYEE.SALARY-AMOUNT) GROUP BY EMPLOYEE.DEPT-ID LEVEL 1 Display lines: Detail X and/or Summary X Group by all _ Compute: 1=HELP 3=QUIT 4=MESSAGE 5=DISPLAY 6=MENU 11=HEADER