on 2024 Mar 13 4:36 PM
Hello experts,
Im trying to multiply two measures using advanced formulas in a data action but doesnt work, i cant see any result.
- first measure: Quantity --> Im saving this measure in a previous step with the following code.
(im saving in all dimensions #)
MEMBERSET [d/Date] = "202501" TO "202512"
DATA([d/Measures]="Quantity",
[d/P_COMERCIAL]="#",
[d/P_CURRENCY]="#",
[d/P_FLAG_PERIODOS]="#",
[d/P_PLANT]="#",
[d/Date]="203112") =
RESULTLOOKUP([d/Measures]="KVEN02")
- second measure: porcentaje --> the final user save this value in a table. As you can see, all the values are stored in #
With this, if i try to save the first value and secondi can successfully. Moreover, i can do an addition or a subtraction and work.
This is my code when i try to multiply
DATA([d/Measures]="Quantity",
[d/P_COMERCIAL]="#",
[d/P_CURRENCY]="#",
[d/P_FLAG_PERIODOS]="#",
[d/P_PLANT]="#") = RESULTLOOKUP([d/Measures]="Porcentaje",
[d/P_COMERCIAL_CLIENTE]="#",
[d/P_COMERCIAL]="#",
[d/P_CURRENCY]="#",
[d/P_CUSTOMER]="#",
[d/P_DISTR_CHAN]="#",
[d/P_FLAG_PERIODOS]="#",
[d/P_MATERIAL]="#",
[d/P_PLANT]="#",
[d/P_REPRESENTANTE]="#",
[d/P_SALESUNIT]="#",
[d/P_ZFAMIAGR]="#",
[d/P_ZFAMIAGR3]="#") *
RESULTLOOKUP([d/Measures]="Quantity",
[d/P_COMERCIAL]="#",
[d/P_CURRENCY]="#",
[d/P_FLAG_PERIODOS]="#",
[d/P_PLANT]="#",
[d/Date]="203112")
each month have a different value for porcentaje measure
I need multiply Quantity * Porcentaje in the following image, as you can see all 2025 are empty
Please help, im really stuck. I've already read another similar questions, for example:
But i dont know what is my problem.
Cheers.
Request clarification before answering.
Hi everyone,
Im still stuck, does anyone know how I can do it?
please help!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
MEMBERSET [d/Date] = "202501" TO "202512" DATA([d/Measures]="Quantity", [d/P_COMERCIAL]="#", [d/P_CURRENCY]="#", [d/P_FLAG_PERIODOS]="#", [d/P_PLANT]="#", [d/Date]="203112") = RESULTLOOKUP([d/Measures]="KVEN02")
In the above code the remaining dimensions will taken from right side of RESULTLOOKUP()
Multiplication and Division work with keys on all dimension members. It means that it will work by matching all dimension values in the record.
The easiest way to make this work is by looking at the data intersection of both Quantity and Percentage in terms of all dimension. Then while multiplying , mention all the dimension explicitly within RESULTLOOKUP() which do not share common master data value between 2 records. Without seeing you data intersection its pretty tough to say which dimension is not common. Just goto the modeler view of the model and filter 1 record for both quantity and percentage and see which dimensions share common master data and which not.
Br.
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The user have a table tu store the porcentage value, in this table the only one measure is Country, just because they need apply globally this %(porcentage ) increase over the Quantity measure.
I think, when you save a value in a table with just one dimension, all others are going to be unassigned. That is why im putting # in my data action code when i call porcentage measure.
Moreover, the measure quantity have only five unassigned dimensions
[d/P_PLANT]="#"
[d/P_COMERCIAL]="#",
[d/P_COMERCIAL_CLIENTE]="#",
[d/P_FLAG_PERIODOS]="#",
[d/P_CURRENCY]="#"
all others have master data but i cant specify one by one because i need apply this increase by country.
Maybe my approach is wrong or it is not posible to do it in SAC.
What do you think?
Thanks!
Multiplication and Division will only work if you specify all non common dimension members explcitly in the resultlookup(). I would suggest first drill down both Quantity and percentage records in terms of all dimension and then see what dimension values are not common between them and then specify it in the RESULTLOOKUP(). From your example I see you specify more dimensions on percentage side but only few on Quantity.
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your response.
Sorry for my question, but, what do you mean with
"...if you specify all non common dimension members explcitly in the resultlookup()."
do i have to specify all the dimension that have data for one measure but not for the other?
About your observation, I have just few dimensions for quantity measure because they are the ones i indicating in the previous step, and all of they are "unassigned" the other dimensions have data.
MEMBERSET [d/Date] = "202501" TO "202512"
DATA([d/Measures]="Quantity",
[d/P_COMERCIAL]="#",
[d/P_CURRENCY]="#",
[d/P_FLAG_PERIODOS]="#",
[d/P_PLANT]="#",
[d/Date]="203112") =
RESULTLOOKUP([d/Measures]="KVEN02")
for this reason im leaving these dimension
im really lost, sorry.
Thanks
User | Count |
---|---|
66 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.