Dear All,
I am trying to write a script logic with a PRIOR formula.
So far, I always used the PRIOR for the previous period (-1). But never for more than a period.
I am now trying to use PRIOR(-12) to take data from the previous year, same month. And it is not working!
I doubt that the problem come from my logic because it is really simple. Moreover this logic works when I put only PRIOR, that is to say when I grab data from the previous month.
Could someone test if the PRIOR(12) is working in your environment please?
I am running SAP 5.0.502.03 (SP3) with SQL 2005.
Thanks a lot for your precious help
Nic
For your info, here is my logic:
*PROCESS_EACH_MEMBER = TIME
*XDIM_MEMBERSET ACCOUNT=Descendants([A10700],99,LEAVES)
*XDIM_MEMBERSET GBU=<All>
*XDIM_MEMBERSET TIME=PRIOR(12),%TIME_SET%
*XDIM_MEMBERSET ACCTDETAIL=<All>
*WHEN ACCTDETAIL
*IS "No_F"
*WHEN TIME
*IS PRIOR(12)
*REC(ACCTDETAIL="BASEYR_F",TIME=%TIME_SET%)
*ENDWHEN
*ENDWHEN
and here is an extract of the Logic Guide from SAP:
The time shift instructions
To simplify the calculation of leads and lags in financial reporting applications, the following new
instructions have been implemented for SQL-based logics:
PRIOR
NEXT
BASE
FIRST
The instructions PRIOR and NEXT support an optional numeric parameter. This parameter represents the
number of time periods by which the current period must be shifted. If omitted, the functions will assume a
time shift of 1 period (forward or backwards). Negative values are accepted (A negative value for a NEXT
function corresponds to a positive value for a PRIOR function and vice-versa).
Examples:
TIME=NEXT // In a monthly application this means next month
TIME=PRIOR(3) // Three periods backwards
TIME=NEXT(-3) // Same as PRIOR(3)