2024 May 16 2:15 PM - edited 2024 May 16 2:17 PM
Hello everyone,
in SAC, the data that is copied from actual to FC version should be extrapolated.
Example:
Actual were copied into FC version until February. The extrapolation was carried out from March to December, based on average of Actual.
The number of copied ACTUAL months is entered in the popup. The variable is used to calculate the average.
The following formula is used:
MEMBERSET [d/Measures] = "Z_S4_HSL"
MEMBERSET [d/Date] = [d/Version].[p/StartDate] TO [d/Version].[p/EndDate]
VARIABLEMEMBER #DATE OF [d/Date]
//-----------------------------------------------------------------------------------
// Calculate Average of ActualValue
DATA([d/Measures] = "Z_S4_HSL",[d/Date] = #DATE) = RESULTLOOKUP([d/Measures] = "Z_S4_HSL") / %ZMM_ACT_PERIOD_UNTIL%
// Calculate FC Extrapolated
IF %ZM_ACT_PERIOD_UNTIL% + 1 = 2 THEN
DATA ([d/Date] = PREVIOUS(10, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(9, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(8, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(7, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(6, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(5, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(4, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(3, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(2, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(1, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
ELSEIF %ZM_ACT_PERIOD_UNTIL% + 1 = 3 THEN
DATA ([d/Date] = PREVIOUS(9, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(8, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(7, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(6, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(5, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(4, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(3, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(2, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
DATA ([d/Date] = PREVIOUS(1, "MONTH", [d/Version].[p/EndDate])) = RESULTLOOKUP([d/Date] = #DATE)
ELSEIF %ZM_ACT_PERIOD_UNTIL% + 1 = 4 THEN
……..
The formula repeats until month 12 is reached
ELSEIF %ZM_ACT_PERIOD_UNTIL% + 1 = 12 THEN
DATA( [d/Date] = [d/Version].[p/EndDate]) = RESULTLOOKUP([d/Date] = #DATE)
ENDIF
Does anyone have any ideas on how the formula could be made simpler?
Thank You!
Marm
Request clarification before answering.
Hi Marm,
I think it can be largely simplified, by using 'until month' as parameter and two formula steps in data action.
1. copy from actual and calculate average
MEMBERSET [d/Measures] = "SignedData"
MEMBERSET [d/Date] = [d/Version].[p/FIRST_PERIOD] TO %Period%
MEMBERSET [d/Account] = "H111100"
MEMBERSET [d/Region] = "REG0002"
VARIABLEMEMBER #ALL OF [d/Date]
DATA() = RESULTLOOKUP([d/Version] = "public.Actual")
DATA([d/Date] = #ALL) = RESULTLOOKUP()
DATA([d/Date] = "000000" ) = RESULTLOOKUP([d/Date] = #ALL)/ MONTH(%Period%)
2. copy average to remaining periods
MEMBERSET [d/Measures] = "SignedData"
MEMBERSET [d/Date] = NEXT(1,"MONTH",%Period%) TO [d/Version].[p/LAST_PERIOD]
MEMBERSET [d/Account] = "H111100"
MEMBERSET [d/Region] = "REG0002"
DATA() = RESULTLOOKUP([d/Date] = "000000")
Best regards, William
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
30 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.