on 2025 Feb 18 1:37 PM
Hello Experts,
I am trying to do a multiplication inside SAC advanced formulas, I know that multiplication in advanced formula works somehow different then addition and subtraction. Below is my code and I am trying to figure out what I am doing wrong basically.
CONFIG.HIERARCHY = [d/DIM_COSTCENTER].[h/H1]
MEMBERSET [d/DIM_BUDGETYEAR] = "2025"
MEMBERSET [d/DIM_AUDIT] = "INPUT_HR"
MEMBERSET [d/Measures] = "Amount"
MEMBERSET [d/DIM_BUSINESSLINE] = "GEN"
MEMBERSET [d/DIM_DETAILITEM] = "#"
MEMBERSET [d/DIM_PHASE] = "#"
MEMBERSET [d/DIM_SCENARIO] = "#"
MEMBERSET [d/DIM_ACCOUNT] = BASEMEMBER([d/DIM_ACCOUNT], "51100000")
MEMBERSET [d/DIM_COSTCENTER] !="#"
// Define variables
VARIABLEMEMBER #x OF [d/Measures]
VARIABLEMEMBER #y OF [d/Measures]
// Store actuals for 2025 in #x
DATA([d/Measures] = #x) =
RESULTLOOKUP([d/DIM_AUDIT] = "LOAD_ACTUALS", [d/DIM_BUDGETYEAR] = "2025", [d/Version] = "public.Actual", [d/DIM_SCENARIO] = "G_RO")
// Store input HR values in #y for unassigned cost center
DATA([d/Measures] = #y, [d/DIM_COSTCENTER] = "#") =
RESULTLOOKUP([d/DIM_COSTCENTER] = "#", [d/DIM_BUDGETYEAR] = "#", [d/DIM_SCENARIO] = "#", [d/DIM_AUDIT] = "INPUT_HR", [d/Version] = "public.Plan")
// Loop through cost centers (excluding unassigned)
FOREACH [d/DIM_COSTCENTER]
// Ensure values exist before multiplying
IF RESULTLOOKUP([d/Measures] = #x, [d/DIM_COSTCENTER] = [d/DIM_COSTCENTER]) != NULL AND
RESULTLOOKUP([d/Measures] = #y, [d/DIM_COSTCENTER] = "#") != NULL THEN
DATA([d/Measures] = "Amount", [d/DIM_COSTCENTER] = [d/DIM_COSTCENTER], [d/Date] = "202512") =
RESULTLOOKUP([d/Measures] = #x, [d/DIM_COSTCENTER] = [d/DIM_COSTCENTER]) *
RESULTLOOKUP([d/Measures] = #y, [d/DIM_COSTCENTER] = "#")
ENDIF
ENDFOR
Request clarification before answering.
Easiest Way to solve multiplication issue is as below.
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
64 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.