Overview
Version
Report Server Version |
---|
11.0.4 |
Application Scenario
The MOM function is used to calculate the comparison with the previous period. For example, you can calculate the comparisons with the same period and the previous period of the gross domestic production for each quarter by the MOM function, as shown in the following figure.
Function Description
FineReport V11.0.4 supports the calculation of the comparisons with the same period and the previous period.
Note: The hierarchical coordinate function only supports cell calculations. The sheet, watermark, JavaScript reference, and default parameter value calculations are not supported.
Function Explanation
1. Overview
Syntax | MOM(Range,Number,Shift,Boolean) | Calculates the comparisons with the same period and the previous period. |
Parameter 1 | Range | The cell based on which the data is grouped |
Parameter 2 | Number | The range of data that needs to be calculated |
Parameter 3 | Shift | Omissible offset, with the default value -1 For example, if you want to calculate the comparison of each month with the month before the last, enter -2. |
Parameter 4 | Boolean | Represents the horizontal or vertical expansion and can be omitted. If it is omitted, data will be expanded by default following the expansion direction of the cell where Parameter 2 is located. True indicates the vertical expansion, while False indicates the horizontal expansion. |
2. Example
Cell A1 represents the column where Year is located, cell B1 represents the column where Month is located, and cell C1 represents the Monthly Production Data.
MOM(B1,C1) represents the month-on-month comparison of each month. The month-on-month comparison for the first month is 0 by default.
Due to the expanding attribute of the report, MOM(A1,C1) represents the comparison of the month of each year with the same month of the previous year, namely, the year-on-year comparison. The year-on-year comparison for the first year is 0.
Calculating the Comparison of the Same Period
Report Design
Enter =MOM(A2,C2) in cell D2, enter =MOM(B2,C2) in cell E2, and enter Comparison with the same period and Comparison with the previous period in cell D1 and cell E1 respectively, as shown in the following figure.
Formula description:
Formula | Description |
MOM(A2,C2) | Due to the expanding attribute of the report, MOM(A2,C2) represents the comparison of the month of each year with the same month of the previous year, namely, the year-on-year comparison. The year-on-year comparison for the first year is 0. The expansion direction is set to Horizontal for cell D2 by default. |
MOM(B2,C2) | Represents the month-on-month comparison of each month. The month-on-month comparison for the first month is 0 by default. The expansion direction is set to Horizontal for cell E2 by default. |
Effect Display
PC
Save the report, and click Pagination Preview. See the effect in section "Application Scenario."
Mobile Terminal
The preview effects on the DataAnalyst app and the HTML5 terminal are the same, as shown in the following figure.
Template Download
For details, you can click to download the template: MOM.cpt.