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

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

Helper variableDescription
cohortCreates a Cohort Dimension.
daysinmonthReturns the total number of days in the calendar month.
fiscalmonthFiscal month of the current time step. Must be an integer between 1 and 12.
fiscalyearFiscal year of the current time step. Must have Fiscal Year toggled on.
lastActual​DateReturns 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.
monthIndexes 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.
blankEnables you to call blank variables in an if statement. E.g. if an employee has no end date: if End Date = blank then X else Y.
numtimestepsReturns 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.
quarterIndexes 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 dateReturns 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.
todayReturns 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.
yearIndexes the calendar year. Useful for setting different values/formulas for different years. E.g. if year = 2022 then X else Y.

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.