Calculating the running subtotal for numeric values grouped by period

Use the Calculate subtotals transformer to calculate the running subtotal for a set of numeric values grouped by a period of time, either weekly, semimonthly, monthly, quarterly, or annually.

For accounting purposes, it is often necessary to produce subtotals of numeric values for basic periods of time. This is most frequently encountered in payroll calculations where companies are required to produce month-to-date and year-to-date subtotals for various types of payroll data.

The Calculate Subtotals transformer uses a Warehouse target table as a source. The table that you use as a source must contain a primary key. The transformer writes to a table on the same database. Before you define this step, link the Warehouse target to the step in the Process Modeler, with the arrow pointing towards the step.

You can make changes to the step only when the step is in Development mode.

../byb.gif Authorities and privileges

To define a Calculate Subtotals transformer:

  1. Open the step notebook.

  2. Specify information for your step:

  3. Click the Parameters tab

  4. Optional: Click columns from the Available columns list to order the output data. Then, click the > button that is adjacent to the Order by columns list.

  5. From the Available columns list, click the date column in the input table. The column data type must be DATE or TIMESTAMP. Then, click the > button that is next to the Date column field.

  6. Define a subtotal calculation.

  7. On the Column Mapping page, map the output columns that result from the transformation that you defined on the Parameters page to columns on your target table. On the Column Mapping page, output columns from the Parameters page are referred to as source columns. Source columns are listed on the left side of the page. Target columns from the output table linked to the step are listed on the right side of the page. Use the Column Mapping page to perform the following tasks:

    If the Parameters page produces no output columns, or if this step is not linked to a target table and you have not specified automatic generation of a default table in the Parameters page, you will not be able to use this page to map your columns. Some steps will not allow you to change the column mapping.

  8. On the Processing Options page, in the Agent Site list, select an agent site where you want your step to run. The selections in this list are agent sites that are common to the source tables, the target table, and the transformer or program that you are defining.

  9. If you want to have the option to to run your step at any time, select the Run on demand checkbox. Your step must be in test or production mode before you can run it.

  10. Optional: Select the Populate externally check box if the step is populated externally, meaning that it is invoked in some way other than by the Data Warehouse Center. The step does not have to have any other means of running in the Data Warehouse Center in order to change the mode to production.

    If Populate externally is not selected, then the step must either have a schedule, be linked to a transient table that is input to another step, or be started by another program in order to change the mode to production.

  11. In the Retry area, specify how many times you want the step to run again if it needs to be retried and the amount of time that you want to pass before the next run of the step.

  12. In the Log table field, specify a log table.

  13. In the Trace level field, specify a trace level.

  14. Click OK. to save your changes and close the step notebook.

Related information

Moving and transforming data

Population type descriptions

List of steps and step subtypes

Data Warehouse Center concepts