The MONTHVALUE function references another line item and returns the monthly time summary value for each time period within that month. The function replaces the period's individual value with the corresponding monthly summary.
For example, you can use the MONTHVALUE function to identify what percentage a given week contributes to monthly sales.
Syntax
MONTHVALUE(Line item)
Arguments
| Argument | Data type | Description |
| Line item | Number, Boolean, date, time period, list, text | The line item to reference the monthly time summary value for. |
The MONTHVALUE function returns a result of the same data type as the line item you reference.
Calculation engine functionality differences
In Polaris, you can't use the MONTHVALUE function in a result line item with a time scale greater than the function.
The Classic Engine returns a value of 0 in this case.
Constraints
- If the line item you reference has a time scale of Quarter or above, then the reference returns the line item's default value. For example,
0for numeric line items. - You can't use the MONTHVALUE function in a model that has the Calendar Type set to Weeks: General.
Examples
In this example, a Product sales module has line items on rows and Time on columns:
- The Weekly sales and the Monthly sales line items have Number data types
- The Week above average for month line item has a Boolean data type
In Blueprint view, in the Summary column for Weekly sales, Time Summary is set to Average. The formula for the Monthly sales returns the monthly summary average for every week of the month. The formula for the Week above average for month returns a TRUE result for values that are below the average value for each week of the month.
| Week 1 FY21 | Week 2 FY21 | Week 3 FY21 | Week 4 FY21 | |
| Weekly sales | 833 | 860 | 867 | 812 |
Monthly salesMONTHVALUE(Weekly sales) | 843 | 843 | 843 | 843 |
Week above average for monthWeekly sales > MONTHVALUE(Weekly sales) |