About using a column for calculation purposes only

You can use a column for calculation purposes only by defining it as a ghost column. A ghost column is a column that can be referenced in a calculation, but does not print on a report. For example, you can create a report that calculates the difference between last year's sales and the current year's sales and have the report print only the difference, even though sales amounts for both years display on the format form. Last year's sales and the current year's sales are defined as ghost columns, but are referenced in the compute statement to determine the difference.

Ghost column considerations

Consider these guidelines when defining a ghost column:

  • A ghost column must precede the compute statement that references it.

  • Because ghost columns do not print, you do not need to define column widths or print characteristics for them.

  • You must have at least one space between ghost columns and other columns.

Examples of referencing ghost columns

You can reference a ghost column with select data dictionary names or in a compute statement. These examples show common examples of how you can use a ghost column with a Lawson data dictionary name:

  • The COLM( ) data dictionary item sums the columns that are specified in the parentheses: COLM(2-6) sums the amounts in columns two through six. You can include just the total for the five columns without displaying the actual columns.

  • The PCTBAS data dictionary item calculates the percent of base for the column you specify: PCTBAS(2) divides the amount in column two by the base amount for column two to calculate the percent of base. Make column two a ghost column to display only the percent of base amounts.

  • You can define a report that includes the current period amount (CPAMT), defined as COLM(1), and the last year current period amount (LCPAMT), defined as COLM(2), as ghost columns. Then, you can define this compute statement to print only the difference between these two columns in the report: COLM(1) - COLM(2).