Group by Rollup Example

Group by Rollup Example
lac31
This article details the Group By - total sales by month and salesrep example. This example illustrates the Replicate Junction pattern, reflecting end-point changes.
It is common to sub-total objects by grouping them. For example, you can monitor sales activity by grouping orders by year, month, and 
salesrep
. These totals are maintained in the 
empsales
 table. The rows in the 
empsales
 table are sub-totals and not real entities. It can be cumbersome to create the rows. Instead, you can create the rows automatically using managed parent. The result is we can implement the Group By.
For more information:
The derivations to compute the foreign key and total_sales are straight-forward. The following image shows the computed foreign key to the managed parent:
CA Technologies
The following image shows the logic:
 CA Technologies