on 05-25-2016 2:43 AM
I am attempting to do what appears to be a fairly simple calculation.
In marketing documents use a formatted search (with a manual refresh) to calculate a price/per kg.
The formula is Gross Total (LC) / Weight. I am using the Gross Total because I want to take into account any discount applied.
SELECT $[38.288.number] / $[$38.58.number]
The behavior is very weird.
If I apply no discount it will calculate completely incorrectly. i.e. 5,040.00 / 2,100 will give me 2.
If I add even a 0.01% discount it will correctly calculate the amount - i.e. 2.4.
I have no idea where the number 2 is coming from.
I also tried an alternative calculation diving the gross price by the weight per item.
SELECT $[$38.20.number] / (($[$38.58.number] / $[$38.11.0]))
Any help would be appreciated.
I am running in SAP 9.2 Patch 02.
If all number are integer, then the result is integer, this is where the 2 comes from.
So in your case, u need to force one of the number to be float
SELECT CAST($[38.288.number] AS DECIMAL(18,4)) / $[$38.58.number]
With one decimal inside calculation, everything should be fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.