Adding a Column to an FML Report

The request controls the number of columns in any report. For instance, if a request contains the display command SUM AMOUNT AND FORECAST, the report contains two columns: AMOUNT and FORECAST.

Add columns in an FML request, just as in a TABLE request, using the COMPUTE command to calculate a value or simply to allocate the space, column title, and format for a column.


Top of page

Example: Adding a Column to an FML Report

This example uses a COMPUTE command to generate the calculated value CHANGE and display it as a new column in the FML report. The following request generates an FML matrix with four rows and three columns of data.

DEFINE FILE LEDGER
CUR_YR/I5C=AMOUNT;
LAST_YR/I5C=.87*CUR_YR - 142;
END
 
TABLE FILE LEDGER
SUM CUR_YR AS 'CURRENT,YEAR'
   LAST_YR AS 'LAST,YEAR' 
COMPUTE CHANGE/I5C = CUR_YR - LAST_YR; 
FOR ACCOUNT
1010 AS 'CASH ON HAND'                  OVER
1020 AS 'DEMAND DEPOSITS'               OVER
1030 AS 'TIME DEPOSITS'                 OVER
BAR                                     OVER
RECAP TOTCASH/I5C = R1 + R2 + R3; AS 'TOTAL CASH'
END

The output is shown in the following image.

report

Note: The designated calculation is performed on each tag or RECAP row of the report. The RECAP rows, however, may change the calculation.


Top of page

Example: Adding a New Time Period as a Column

The following request adds a future time period to a report.

DEFINE FILE LEDGER
CUR_YR/P5C=AMOUNT;
LAST_YR/P5C=.87*AMOUNT - 142;
END
 
TABLE FILE LEDGER
SUM AMOUNT 
ACROSS YEAR AND COMPUTE 1999/P5C = 2.5*AMOUNT; 
FOR ACCOUNT
1010 AS 'CASH ON HAND'                   OVER
1020 AS 'DEMAND DEPOSITS'                OVER
1030 AS 'TIME DEPOSITS'                  OVER
BAR                                      OVER
RECAP TOTCASH/P5C = R1 + R2 + R3; AS 'TOTAL CASH' OVER
RECAP CHANGE(2,*) = TOTCASH(*) - TOTCASH(*-1);
END

The output is shown as follows.

report


WebFOCUS