Start a new topic

Custom Margin Formula

I need to do a custom gross profit % formula that takes our service costs out of the total price of the job.


Here is what I tried along with several longer versions where I don't reference formulas, 

documentheaders->profitamount/(.001+(abs(documentitems->extendedprice)-calc->service_total))*100


I put .001 in the formula to get rid of the divide by zero error.  On the document I've used for testing, this should yield 18.12, but it gives me -332.

Profit amount when not in a formula shows- 11,050.10

Extended Price when not in a formula shows- 64,295

formula service_total shows- 3,325


help please.


There might be something with summarization totals causing the sorts of number problems here.

Are you able to share your layout and an example quote?


Matt Rose

matt@prestigequoting.com

QuoteWerks MVP

I've attached the layout.  I can get you a PDF of a fake quote with widgets and super high numbers although the quote won't show you the costs.  Do you want the quote/costing in a different form?


The "service_total" portion is a summation of other formulas- calc->travel_exp+calc->startup


I have attempted to replace the formula reference (calc->service_total) with its formula (calc->travel_exp+calc->startup), which didn't work.  I also tried substituting those formula references with their actual data and had no change in the results.


All of the various formulas work fine as written when standalone.



FPC

Thanks for sharing that.


If you were able to take a quote, go File > Export to Document Transport File - that should give me the ability to import your quote into my QuoteWerks system. I'll then be able to see exactly what you're experiencing and, hopefully, advise of the issue/fix.

Here is a completely made up quote for a garage door.  Once the service costs are taken out of the revenue for margin calculation, the margin should be 50%.

DTF
FPC

Hi Debra,


Really struggling to see this.

I previewed your layout with example quote and it shows (I presume we're looking at VLS Margin?) at 49%

I set this to display 2 decimal places, but suppressing trailing zeros.


This gives me 50%


Am I doing something wrong?


Would it be easier to have a screen sharing session and you can show me?

matt@prestigequoting.com


Thank you Matt.  That was a perplexing issue but you helped me solve it.


Originally: documentheaders->profitamount/(.001+(documentitems->extendedprice)-(calc->service_total))*100


Resolution was to reference a header field for price instead of document lines: documentheaders->profitamount/(documentheaders->subtotal-calc->service_total)*100

Login or Signup to post a comment