SAP Knowledge Base Article - Public

2712387 - SAP Analytics Cloud (SAC) - Dynamic references in LastPeriods

Symptom

  • Creating a formula that contains LastPeriods results in error if the period is defined dynamically.
  • For example: LOOKUP([AMT], [d/Time] = LastPeriods ("Month",[NUM]))
  • For such a formula to work, the number must be defined within the formula.
  • It doesn't work if it references a measure.
  • Even if the measure contains numbers, SAP Analytics Cloud does not accept the formula and provides an error message:   "Formula could not be computed: Function LastPeriods expects parameter 2 of type "Number", but receives "Number"; try using the expected parameter type. Try rewriting the formula."

Environment

  • SAP Analytics Cloud 2018.18

Reproducing the Issue

  1. Create a new model.
  2. Create an account dimension.
  3. Create three items: AMT, AMT_MEAN, and NUM.
  4. Define "NUM" with the following formula: MOD(DECFLOAT([d/Time].[p/CALMONTH]),100)
  5. Define "AMT_MEAN" with the following formula: LOOKUP([AMT],[d/Time] = LastPeriods ("Month",[NUM]))

Cause

  • The “LastPeriods“ formula is not designed to work with dynamic inputs.
  • Only constant numbers can be used in the formula.

Resolution

This is a feature enhancement and may be considered in a future release

See Also

Your feedback is important to help us improve our knowledge base.

Keywords

SAP Cloud for Planning, sc4p, c4p, cforp, cloudforplanning, EPM-ODS, Cloud for Analytics, Cloud4Analytics, CloudforAnalytics, Cloud 4 Planning, BOC, SAPBusinessObjectsCloud, BusinessObjectsCloud, BOBJcloud, BOCloud., SAC, SAP AC, Cloud-Analytics, CloudAnalytics, SAPCloudAnalytics , KBA , LOD-ANA , SAP Analytics Cloud , LOD-ANA-BI , SAP Analytics Cloud - Business Intelligence (BOC) , LOD-ANA-BR , SAP Analytics Cloud - Digital Boardroom , LOD-ANA-PL , SAP Analytics Cloud – Planning (BOC) , LOD-ANA-PR , SAP Analytics Cloud – Predictive (BOC) , Problem

Product

SAP Analytics Cloud 1.0