If the number of regular (not calculated) columns varies in the report because multiple sections in the report have different numbers of columns, the column numbers used to identify the calculated columns shift accordingly, as illustrated:
If the first section of a report has 12 columns (including row name columns), and three calculated columns are declared, column numbers 0–11 are the regular columns, and columns 12–14 are the calculated columns.
If a second section of the report reduces the number of regular columns to six, then the regular columns are columns 0–5, and the same calculated columns are columns 6–8.
Similarly, if the number of regular columns is increased, the numbering of the calculated columns starts at a higher number.
In the example, CC1, CC2, and CC3 represent the names of three calculated column names. The column numbering for a report with two different sections with varying numbers of regular columns:
internal col # s: 0 1 2 3 4 5 6 7 Jan Feb Mar Apr CC1 CC2 CC3 === === === === === === === Sales 1 3 5 3 22 55 26 Expense 1 2 5 3 23 65 33 same report- new section internal col # s: 0 1 2 3 4 5 Qtr1 YTD CC1 CC2 CC3 === === === === === Sales 2 9 22 57 36 Expense 4 8 56 45 33
If you do not want the calculated columns in the second section, or if you need a different set of column calculation, use the command REMOVECOLCALCS to clear the old ones out. You can then define new column calculations.
This example assumes that all three column calculations had no references to regular columns other than columns 1 and 2. If CC3's calculation were = 1 + 3 + 6, when the second section of the report starts, an error occurs stating that the column calculation referred to a nonexistent column (6).