on 08-11-2015 2:53 PM
I have a requirement in Query that is:
For a particular Sales Order No and Sales Order Item and InfoObject "Y" =1,
if InfOObject "X" = AB, add KF1,
else if InfoObject "Z" = AC, subtract KF1
Note: InfoObject Y, X & Z are characteristics not KeyFigures
How can this be achieved in Query Designer?
Thanks in advance.
Regards,
Pramod
There was a small mistake in what is mentioned above
For a particular Sales Order No and Sales Order Item and InfoObject "Y" =1,
if InfOObject "X" = AB, add KF1 (for that particular SO and SO Item),
else if InfoObject "Z" "X" = AC, subtract KF1 (for that particular SO and SO Item)
Note: InfoObject Y,& X Z are characteristics not KeyFigures
Hope this example helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you give other samples?
What do you mean by add or subtract KF1? Add all the KF1 and subtract all the KF1 when AB and AC, respectively?
I mean,there is no problem in the addition,but in the subtraction part how will you know which number is the MINUEND in your example? For example the 4th line has a value of KF1 = 20 so the result will be -10?
MINUEND - SUBTRAHEND = DIFFERENCE
Regards,
Loed
Hi Loed,
I do not have other example, sorry for that.
Yes it means we need to add KF1 when AB and subtract when AC.
It might give negative results sometimes which I think is a problem.That should be OK.
But to how to achieve this is my quesiton. When IO's X and Y are Characteristics (so can't be used in a Formula). Also how to define the condition that when it is equal to AB, do addition and when equal to AC apply subtraction.
Is it achievable? If yes, please let me know the approach.
Regards,
Pramod
HI Loed,
Thanks for your solution, will try it in Query.
The report layout will be something similar to the one shown below, KF2 is the result of addition and subtracion and they will be in the single column. Ofcourse there are many other fields which
are not shown
I have to create two RKF's
RKF_Y_AB
KF1
restrict by SO
restrict with SO Item
restrict with Y - 1
restrict by X - AB
RKF_Y_AC
KF1
restrict by SO
restrict with SO Item
restrict with Y - 1
restrict by X - AC
So how to do this addition part when InfoObject X = AB & subtraction when X = AC.
The way you have explained I believe will not give solution to the subtraction part at least.
Correct me if I have missed something in understanding your solution.
Regards,
Pramod
Hi,
What I can't understand is how are you going to choose which is the MINUEND or the SUBTRAHEND..
Do you always have two (2) entries as shown in your example? If not, what if you have more than 2 values, let's say, the values are 10, 10, 50, and 40 for objects which has a value of X = AC? What will be the result?
Regards,
Loed
Hi Loed,
The point made by you is absolutely right. Depending on the what is in first place the value varies.
But let's forget that as I do not have complete details of what is required.
Without giving much consideration to the values or the result, I wanted to know if it is doable
Adding and subtracting both depending on Characteristic values.
Regards,
Pramod
Hi ,
Instead of doing at query level , better try do same at transformation level . At transformation level it is easy to do it.
I have to create two RKF's
RKF_Y_AB
KF1
restrict by SO
restrict with SO Item
restrict with Y - 1
restrict by X - AB
RKF_Y_AC
KF1
restrict by SO
restrict with SO Item
restrict with Y - 1
restrict by X - AC
after creating RKF create CKF/formula use count(RKF_Y_AB) it will return 1 if record type with AB exists else it will show 0.
Thanks.
Hi,
Try this:
KF1_AB
X - filter with AB
KF1
KF1_AC
X - filter with AC
KF1
KF1_DUMMY
X - filter with AC
KF1
exception aggregation FIRST VALUE
(try first without choosing a reference characteristic, if it didn't work then try using with reference characteristic based on X object)
SUM_AB_AC_DUMMY
KF1_AB + KF1_DUMMY - KF1_AC
If that works, the logic for the difference will be, let's say the first value is 10, so we need to get -100:
KF1_AB + KF1_DUMMY - KF1_AC
0 + 10 - 110 = -100
I'm not sure though if it will work..
Anyway just try it..
Regards,
Loed
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.