Displaying Absolute Values

Reference:

On certain types of reports, negative values are displayed without a minus sign (-) or any other indication of a negative value.

In order to suppress the display of a negative indicator on FOCUS report output, you can use the A option with any numeric format in a DEFINE or COMPUTE command or in the USAGE format for a field in a Master File. This option affects only the display, not the stored value. To calculate the absolute value, use the ABS function.


Top of page

x
Reference: Usage Notes for the Negative Suppress USAGE Attribute


Example: Displaying Numbers With Negative Suppression

The following request against the GGSALES data source sums budgeted dollars and sales dollars and then calculates the difference twice, once in the DIFF field, which has a format that displays minus signs (I8), and once in the SDIFF field, which has a format that suppresses minus signs (I8A).

DEFINE FILE GGSALES 
DIFF/I8 = BUDDOLLARS - DOLLARS; 
SDIFF/I8A = BUDDOLLARS - DOLLARS; 
END
TABLE FILE GGSALES
SUM DOLLARS BUDDOLLARS DIFF SDIFF
BY PRODUCT
ON TABLE COLUMN-TOTAL
END

The DIFF column displays a minus sign (-) with negative numbers. The SDIFF column suppresses the minus sign (-). Note that the signed values are used to calculate the column total.

Product           Dollar Sales  Budget Dollars      DIFF     SDIFF
-------           ------------  --------------      ----     -----
Biscotti               5263317         5290134     26817     26817
Capuccino              2381590         2395456     13866     13866
Coffee Grinder         2337567         2265996    -71571     71571
Coffee Pot             2449585         2472131     22546     22546
Croissant              7749902         7824715     74813     74813
Espresso               3906243         3904540     -1703      1703
Latte                 10943622        10993890     50268     50268
Mug                    4522521         4547785     25264     25264
Scone                  4216114         4152311    -63803     63803
Thermos                2385829         2373820    -12009     12009
TOTAL                 46156290        46220778     64488     64488

The following example adds a HOLD command to the request.

DEFINE FILE GGSALES
DIFF/I8 = BUDDOLLARS - DOLLARS; 
SDIFF/I8A = BUDDOLLARS - DOLLARS;  
END
TABLE FILE GGSALES
SUM DOLLARS BUDDOLLARS DIFF SDIFF
BY PRODUCT
ON TABLE COLUMN-TOTAL
ON TABLE HOLD AS NEG1 FORMAT ALPHA
END

The following values are propagated to the NEG1 HOLD file. Notice that the last column, which represents the SDIFF field, contains signed negative values.

Biscotti         5263317 5290134   26817   26817
Capuccino        2381590 2395456   13866   13866
Coffee Grinder   2337567 2265996  -71571  -71571
Coffee Pot       2449585 2472131   22546   22546
Croissant        7749902 7824715   74813   74813
Espresso         3906243 3904540   -1703   -1703
Latte           1094362210993890   50268   50268
Mug              4522521 4547785   25264   25264
Scone            4216114 4152311  -63803  -63803
Thermos          2385829 2373820  -12009  -12009

The USAGE attribute for the SDIFF field in the NEG1 Master File specifies the A option so that a report against the HOLD file will suppress negative signs for that field.

FILENAME=NEG1, SUFFIX=FIX     , IOTYPE=STREAM, $
  SEGMENT=NEG1, SEGTYPE=S1, $
    FIELDNAME=PRODUCT, ALIAS=E01, USAGE=A16, ACTUAL=A16, $
    FIELDNAME=DOLLARS, ALIAS=E02, USAGE=I08, ACTUAL=A08, $
    FIELDNAME=BUDDOLLARS, ALIAS=E03, USAGE=I08, ACTUAL=A08, $
    FIELDNAME=DIFF, ALIAS=E04, USAGE=I8, ACTUAL=A08, $
    FIELDNAME=SDIFF, ALIAS=E05, USAGE=I8A, ACTUAL=A08, $

Information Builders