Helper Variables in Formulas

Overview

In this article you will find the available helper variables for formulas in Lucanet xP&A.

This article contains the following sections:

Available Helper Variables

The following helper variables are available for formulas in xP&A:


Helper variable

Description


cohort

Creates a Cohort Dimension.


daysinmonth

Returns the total number of days in the calendar month.


fiscalmonth

Fiscal month of the current time step. Must be an integer between 1 and 12.


fiscalyear

Fiscal year of the current time step.

Must have Fiscal Year toggled on.


lastActual​Date

Returns the time step index number of the time step of the Last Actual Date setting.

Must have the setting toggled on in the time settings of a model, otherwise none will be returned. See lastActualDate for more information.


month

Indexes the calendar months from 1-12. Jan = 1, Feb = 2 etc.

Useful for seasonality, or any variables that occur on a particular month each year: if month = 4 then X else Y.


blank

Enables you to call blank variables in an if statement (see blank values here)

E.g. if an employee has no end date: if End Date = blank then X else Y.


numtimesteps

Returns the total number of time steps in the model.

E.g. useful for dividing a value equally over the length of the model:
X / numtimesteps.


quarter

Indexes the quarter from 1-4.

Can be used for calculating variables that reoccur in a particular quarter, e.g. if quarter = 2 then X else Y.


timestep or date

Returns the time step index number of the current time step.

E.g. creating a different formula for the first time step of the model: if timestep = 0 then X else Y.


today

Returns the time step index number corresponding to the current date.

E.g. if you want to set a particular value for today, or months beyond today: if timestep >= today then X else Y.


year

Indexes the calendar year.

Useful for setting different values/formulas for different years.

E.g. if year = 2022 then X else Y.

lastActualDate

lastActualDate is a helper variable that returns the timestep of the Last Actual Date setting, if it is toggled on.

This is useful:

  • If you want to forecast variables using historical averages e.g. average your new users for the last 3 months of actuals/historicals.
Shows the formula: avg (new users for last actual date - 2:last actual date) Forecast Variables based on historical average values
  • Or for having a different formula for your forecast months vs. your ‘actual’ or historical months. E.g. for a Churn % variable, you might want to calculate the actual churn percentage in historical months, but for forecast months this might be an input based off of other variables.
Shows a formula: if date > last actual date then current churn forecast input in % else current churn / current beginning users LastActualDate to calculate the churn.