Insert Functions in Reports

Functions that have Optional as an input parameter are so called index functions. The index functionality can only be used in the report generator. Index functions can be used with an index number, with blank or in some cases with a value as input.

When you create a report in the report generator you will put dimensions, for example account, on either a row or a column. When you later generate the report the index functions will refer to these rows/columns to find a value.

If you use an index number as input in an index function, for example fYear(2), the corresponding row/column index will be used. In this case the function will return the period (year) it finds on the second system row/column.

If Blank is used as a parameter and the index function is entered on a system row/column then the function will return the value, for example period, it finds on that row/column. If the function is not entered on a system row/column, it will return the value it finds on the first system row/column.

As an example, in a report, period is moved to Column Definition on the Axes tab in Reports/Create. In other words periods are chosen for the columns in the report and you can choose different periods on different columns.

Note: Remember that you should never make references to the "blue text" (created by the system) because this text can be changed in the future and your references are lost. Make references to text (or functions) that you insert as Group/Local text in <uicontrol>Column</uicontrol>/<uicontrol>Row Definition</uicontrol> in Reports Create or insert an index number as described above. Of course you can also make references to other functions or values you have inserted in the report yourself.<p>In the index functions where you, besides entering an index number or blank can enter a value, you have to remember to insert double quotation marks (" ") around the parameter if you are inserting a numeric value. For example fAccName("1210") will return the name of the account 1210 while fAccName(1210) will return the name of the account on the system row/column 1210.</p>

Procedure

  1. If you insert the function fYear() without a parameter and not in a cell under a system column, then the function will return the period (year) according to the first system column.
    Note: This period doesn't have to be the same period that you generate the report for.
  2. If you insert the function fYear() without a parameter under a system column, e.g. column F, the function will return the period that is used in that same column.
  3. If you insert the function fYear(2) with index number 2 in it in the report, the function will return the period that is used in system column number 2 in the report. (Every system row/column has a number in it on column A or row number 1 in blue text).