
1. Re: A different kind of percentage calculation??
Sorbsbuster Jan 23, 2012 4:15 AM (in response to Stuee)So you would have a starting point of:
Sub total 100
Discount
Nett 100
freight 25
total 125new total
And you want to enter a overwritten total to be, say 120, so it would look like this:
Sub total 100
Discount 5%
Nett 95
freight 25
total 120(new total 120)
I believe the calculation you want is:
( (SubTotal + Freight )  NewTotal ) / SubTotal
This will show the discount as if it entirely came off the SubTotal, ie: the discount was not applied to the freight.

2. Re: A different kind of percentage calculation??
Stuee Jan 23, 2012 1:25 PM (in response to Stuee)Thanks for that, it works but my only problem now is in the discount field its showing the percentage of the original price not how much discount is applied.

3. Re: A different kind of percentage calculation??
Sorbsbuster Jan 23, 2012 11:13 PM (in response to Stuee)Sorry, I don't understand your post. I thought you wanted the discount to show as a percentage ("...and put the percentage in discount"). Do you want it to show as a $ amount? If that is the case the calculation is
NewTotal  (SubTotal + Freight )

4. Re: A different kind of percentage calculation??
Stuee Jan 23, 2012 11:39 PM (in response to Stuee)the thing you said at the start was correct but instead of it saying discount 10% it was saying discount 90%  showing this the price is 90% of what it was originally and not order has a discount of 10%.
catch my drift :)
thanks

5. Re: A different kind of percentage calculation??
Sorbsbuster Jan 24, 2012 12:27 AM (in response to Stuee)Ah! Then my calc was wrong! Just subtract it from 1.

6. Re: A different kind of percentage calculation??
Stuee Jan 24, 2012 3:32 AM (in response to Stuee)so i would do this
( (SubTotal + Freight )  NewTotal ) / SubTotal 1
??? sorry for seeming so vauge... its late and my brain went to bed a while ago. :)

7. Re: A different kind of percentage calculation??
Sorbsbuster Jan 24, 2012 9:14 AM (in response to Stuee)No, that would be subtracting 1 from it, not it from 1. It should be:
1  ( ( (SubTotal + Freight )  NewTotal ) / SubTotal )
(Although I am confused. Using the figures I gave in my example, the maths should be:
(SubTotal + Freight )  NewTotal ) / SubTotal
=
( ( 100 + 25 )  120 ) / 100
=
( 125  120 ) / 100
That equals 5%, not 95%, so I believe my original calculation is correct.

8. Re: A different kind of percentage calculation??
Stuee Jan 25, 2012 7:15 PM (in response to Stuee)Haha, welcome to my world.
Im not sure how to get it to show what the discount is and not what a percentage of the original numbner is.
Ive been messing with the 1 and things but still no joy :(

9. Re: A different kind of percentage calculation??
Sorbsbuster Jan 25, 2012 11:08 PM (in response to Stuee)You said: "it calculates the percentage difference between new total and subtotal and put the percentage in discount" and "...discount = new total / subtotal as percentage".
To show the absolute $ amount as opposed to the % amount you would not divide it by the original sum. It would be:
(SubTotal + Freight )  NewTotal

10. Re: A different kind of percentage calculation??
Stuee Jan 26, 2012 1:53 PM (in response to Stuee)I think you have lost me again lol.
what im getting is
Sub $75
Freight $25
Discount 75%
Total $100
new total $75

Discount shoud be showing 25% as its 25% discount not 75% which is saying that $75 is 75% of the original total.

11. Re: A different kind of percentage calculation??
Sorbsbuster Jan 27, 2012 1:01 AM (in response to Stuee)I am very confused. Can you please clarify if you want the field called discount to show $x or x%.
If you want it to look like this:
Subtotal $75
Freight $25(true total $100)
Discount 25%
NewTotal $75
Then use this calculation:
( (Subtotal + Freight )  NewTotal ) / (Subtotal + Freight )
In this case that will give the result 0.25, which you can format to display as 25%
If you want it to show as $x then use:
(Subtotal + Freight )  NewTotal
That will show $25

12. Re: A different kind of percentage calculation??
Stuee Jan 27, 2012 4:19 PM (in response to Stuee)Hi.
Im sorry for the confusion.
You are correct originally that i want the customer to see what percentage discount they are getting off the original price,.
Im glad you did the price one too as after i put the % it would end up 0.1 for most jobs and a price value looks better.
The only thing i have now using the price is that it shows the full value if i dont have a number in the newtotal box.
Is there a way to not run the calculation if the newtotal box is empty?
cheers for all your assistance.

13. Re: A different kind of percentage calculation??
Sorbsbuster Jan 28, 2012 12:59 AM (in response to Stuee)" put the % it would end up 0.1 for most jobs"  but you would format the field in the Inspector as a percentage, so that will show as 10%.
To your second question, change the Discount Amount calculation to be:
Case (
IsEmpty ( NewTotal ) ; "" ;
(Subtotal + Freight )  NewTotal
)
will leave the discount field empty if there is no value in newTotal.