Using the last non-empty function for stock data
Most OLTP (Operational) systems contain summary tables to record the on hand quantity of stock. This is recorded at the level of detail appropriate to the system (for example, product item and location).
Of course, the current value of any item or location(s) should be determined by aggregating the net movement of all the prior transactions; however, the performance of such a calculation is unacceptably slow in traditional relational environments. Therefore, in order to retain balance history, the snapshots of the quantities are taken at key dates (say for example, the month end).
A similar type of recording process occurs in data marts and data warehouse environments. In these situations, the fact data (table) is commonly referred to as a periodic snapshot because the snapshot of the data is taken at periodic intervals.
For these types of tables, Stock on Hand quantities cannot be aggregated across time dimensions because the aggregated value...