KPI functions

If you have created KPI mappings in the Exabel app, you can retrieve the proxy time series and the predictions from these mappings using DSL signals referring to the KPI mapping group. You can also retrieve predictions from the auto-models and custom models.

kpi_proxy(kpi_group: int, *, forecast: bool = True, resample: bool = True)

Retrieve the proxy time series from a KPI mapping group.

The company can be used as the evaluation entity if there is only one mapping for that company within the given KPI mapping group. If there are several FactSet segments or Visible Alpha line items that have been mapped for the company, then the KPI must be specified by using the segment or the line item as the evaluation entity.

Every night, the Exabel system calculates the forecasted and resampled version of the proxy time series as part of updating the KPI mapping results. This time series is then persisted. When this DSL signal is used with forecast=True and resample=True (the default), it is this persisted version of the proxy which is retrieved, whereas if either forecast or resample is set to False, the underlying proxy signal is evaluated on the fly (and optionally either forecasted or resampled).

Parameters
  • kpi_group – the id of the KPI mapping group

  • forecast – whether to forecast the proxy time series

  • resample – whether to resample the proxy time series to the fiscal calendar of the KPI

Examples:

Get the forecasted and resampled version of a proxy time series from the KPI mapping group with numeric ID 123:

kpi_proxy(123)

Get the forecasted proxy time series, without resampling:

kpi_proxy(123, resample=False)

Get the raw proxy time series, without forecasting or resampling:

kpi_proxy(123, forecast=False, resample=False)
kpi_predictions(*, kpi_group: int, model: int, series: str, run: int)

Retrieve the KPI predictions from a model.

For each KPI mapping, a prediction for the KPI is produced with a model that only uses the proxy time series as input. These predictions can be retrieved by specifying the KPI mapping group with the kpi_group argument.

For auto-models or custom models, the revisions can be retrieved by specifying the model argument. For these models, when retrieving backtests, the run number can also be specified with the run argument.

The company must be used as the evaluation entity. The signal only works if there is exactly one KPI result belonging to the given company.

Parameters
  • kpi_group – the id of the KPI mapping group

  • model – the id of the prediction model

  • series – either “backtests”, “predictions” or “combined”. Defaults to “combined”, which combines the backtests and the live predictions into one time series.

  • run – the run number to retrieve backtests from. Can only be used with the model argument, and with series being either “backtests” or “combined”.

Examples:

Get the combined predictions from the KPI mapping group with numeric ID 123:

kpi_predictions(kpi_group=123)

Get the combined predictions from the model with numeric ID 123:

kpi_predictions(model=123)

Get the live predictions (without backtests) from the model with numeric ID 123:

kpi_predictions(model=123, series="predictions")

Get the backtests from the model with numeric ID 123:

kpi_predictions(model=123, series="backtests")
kpi_model_revisions(*, kpi_group: int, model: int, period: str)

Retrieve the revisions of KPI predictions for a given fiscal period.

For each KPI mapping, a prediction for the KPI is produced with a model that only uses the proxy time series as input. The revisions from these models can be retrieved by specifying the KPI mapping group with the kpi_group argument.

For auto-models or custom models, the revisions can be retrieved by specifying the model argument.

The company must be used as the evaluation entity. The signal only works if there is exactly one KPI result belonging to the given company.

Parameters
  • kpi_group – the id of the KPI mapping group

  • model – the id of the prediction model

  • period – the name of the period for which revisions should be retrived, for example ‘3Q-2021’, ‘2H-2022’ or ‘FY-2023’, or the last date in the fiscal period, for example ‘2023-09-30’.

Examples:

Get the revisions for the prediction of the 2023-09-30 KPI value from the KPI mapping group with numeric ID 123:

kpi_model_revisions(kpi_group=123, period="2023-09-30")

Get the revisions for the prediction of the 3Q-2021 KPI value from the model with numeric ID 123:

kpi_model_revisions(model=123, period="3Q-2021")