We calculating cumulative sum of salaries on EMP table by DEPTNO as key field.
V_LAST_DEPTNO(Variable port)=DEPTNO
O_SAL(Output port)=V_SAL
- Create source EMP table and design target table with the same source table structure.
- Drag source to the mapping designer.
- First sort the data on DEPTNO by using Sorter transformation.
- Mark DEPTNO as key field and direction is in ascending order.
- Create expression transformation and drag ports from sorter to expression. Create below additional ports and write expressions
V_LAST_DEPTNO(Variable port)=DEPTNO
O_SAL(Output port)=V_SAL