This recipe demonstrates how to calculate accummulative summation in composite datasource.
Steps taken:
- Define the Microsoft Excel file (m20080325.xls) into a tabular datasource (Sample_20080401.ds).
- Create a composite datasource (Sample_Year_CP.ds). Drag and drop the tabular datasource into it as the beginning of the flow.
- Use “Derivative”, “Cube”, “Join”, “Sort” and “Filter” elements properly in the composite datasource, as shown in Sample_Year_CP.ds.
- Enter the following script into the “Script” tab of the composite datasource:
var MonthName =
[“Jan”,“Feb”,“Mar”,“Apr”,“May”,“Jun”,“Jul”,“Aug”,“Sep”,“Oct”,“Nov”,“Dec”];
var QuarterName = [“Q1”,“Q2”,“Q3”,“Q4”];
var 累計 = 0;
var RunningSum = new Array();
To download the necessary files for this recipe, refer to the attached ZIP package.
Sample2.zip