ValQ - Plan
FormulaProductChangelogStart Trial
  • Introduction to ValQ
    • Get ValQ
    • The ValQ Workflow
  • Model
    • Get Data
    • Create Model
      • Dynamic Model
      • Custom Model
      • Import a Model
    • Model Editor
      • Node Operations
      • Editor Features
    • Node Settings
    • Templates
      • Apply Template
      • Manage Template Nodes
      • Import Template
      • Export Template
    • Formula Functions
      • Logical Functions
        • IF
        • SWITCH
        • AND
        • OR
        • NOT
        • XOR
        • IFNAN
      • Math Functions
        • SUM
        • SUBTRACT
        • PRODUCT
        • DIVISION
        • AVERAGE
        • AVERAGEEXZERO
        • AVERAGEEXNEG
        • AVERAGEEXZERONEG
        • COUNT
        • ABS
        • MIN
        • MAX
        • POWER
        • SQRT
        • EXP
        • LOG
        • ROUND
        • FLOOR
        • CEILING
      • Finance Functions
        • IRR
        • NPV
        • PMT
        • IPMT
        • FV
        • PV
        • CUMIPMT
        • CUMPRINC
        • RATE
      • Range Functions
        • RANGE
        • LastNPeriods
        • Get
        • ForEach
        • findByTitle
        • GETCURRENTRANGE
        • GETROWVALUE
        • THIS_SOURCE_KEY
        • PERIOD_LOOKUP
        • PRIOR_SERIES_PERIOD_LOOKUP
      • Static Identifiers
        • THIS/ME
        • CURRENT_SERIES*
        • CURRENT_SERIES_ID*
        • CURRENT_PERIOD_INDEX
        • CURRENT_NODE_VALUES
        • DS.SERIES
      • Node Properties
        • Node Properties Explanation
    • Global Settings
  • Plan
    • Create New Plan
    • Time Series Forecasting
    • Allocation Features
      • Goal Seek
      • Distribute
      • Copy to Periods
    • Driver Based Planning
      • Enabling Driver Based Plan
      • Configuring Driver Inputs
      • Bulk Configuration of Drivers
    • Plan Interface
  • Simulate
    • Create a Scenario
    • Perform Simulations
    • Manage Scenarios
    • Simulation Interface
    • Add Notes
    • Compare Scenarios
    • Scenario Analysis by Node
    • Create Initiatives in a Scenario
      • Steps to create initiatives
    • Create your Presentation
    • Understanding the Node Components
  • Report
    • Variance Analysis Report
  • ValQ Premium FAQs
  • Glossary
  • Resources
  • Release Notes
Powered by GitBook
On this page
  • Syntax
  • Arguments
  • Remarks
  • Example
  • Result
  1. Model
  2. Formula Functions
  3. Range Functions

LastNPeriods

The LASTNPERIODS function refers to the values of the node’s last ‘n’ periods. It will give the result as the last 'n' periods' value.

Syntax

.LASTNPERIODS(n) - > [number]

Arguments

Arguments
Datatype
Description

n

Number

The integer that is less than the number of periods defined in the model.

Remarks

This function can only be used after referring a node for which this calculation needs to be done as shown below in the example.

Example

Consider a scenario where we have interest payments for Jan to Dec. Our objective is to calculate the interest paid in the last 6 months for each month.

2022 Periods
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec

Interest payments

0

78.37

74.06

69.71

65.33

60.91

56.46

51.96

47.43

42.86

38.26

33.61

To achieve this, the following formula should be written in the [Last 6 period's value] node:

SUM([Interest payments].LastNPeriods(6))

We give n as 6 since we want to calculate the last 6 months value. This will calculate the last 6 months value for each period. So for March it will add Jan & Feb, for April it will add Jan to Mar and so on.

Result

Last 6 period's value

0

0

78.37

152.43

222.14

287.47

348.38

404.84

378.43

351.8

324.95

297.88

PreviousRANGENextGet

Last updated 1 year ago