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
                 CURRENT    LAST
                 YEAR       YEAR  CHANGE
                 -------    ----  ------
CASH ON HAND       8,784   7,214   1,570
DEMAND DEPOSITS    4,494   3,482   1,012
TIME DEPOSITS      7,961   6,499   1,462
                  ------  ------  ------
TOTAL CASH        21,239  17,195   4,044

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.

                 YEAR                            
                   1985    1986    1987      1999
-------------------------------------------------
CASH ON HAND      1,684   2,100   5,000     4,210
DEMAND DEPOSITS     619     875   3,000     1,548
TIME DEPOSITS     3,360   4,026     575     8,400
                 ------  ------  ------    ------
TOTAL CASH        5,663   7,001   8,575    14,158
CHANGE                    1,338   1,574     5,583

Information Builders