This document uses the Strategy Tutorial project to demonstrate how to create a custom subtotal using the "Last" function to display the subtotal of an 'End on hand' metric. For this example, an 'End on hand' metric must be created based on the 'Item inventory' fact. The definition of this metric will be as follows:
Sum() {~}
Consider the following scenario where a user wants to display the last month of inventory for the year as the subtotal for a report. This report will include attributes 'Year' and 'Month' and the 'End on hand' Inventory metric. The following procedure describes how to create such a custom subtotal for this purpose:




Once this is completed, users will receive the following report with the last value for the elements in the subtotals:
