Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting my calculated field in the correct place 1

Status
Not open for further replies.

checkley

MIS
Sep 16, 2002
2
US
In my database, the total price of a job is determined
by the sum of the line items in a quotation, thus - Sum ({Quoted_Items.Total Price}). The Costs against the job is similarly determined by the sum of the costs against each line item, thus - (Sum ({Actual_Materials.Cost})). I require to calculate the gross profit on each job (not each line item, eacjh JOB. Thus I construct a formula field - (Sum ({Quoted_Items.Total Price})) - (Sum ({Actual_Materials.Cost})). That's all fine. By my thinking, if I now put this field into the Group header (the line items are grouped by Job) I should get the gross profit for the job. If I put it into the Report Header, I should get the gross profit for all the jobs in the report. If I put it into the detail section (which holds the individual line items) I should get the gross prfit for the appropriate line item. The problem is that WHEREVER I put the field, it reads the gross profit for ALL THE JOBS IN THE REPORT. I must be doing something wrong..........

MOC
 
For a report total, you're current formulas are okay.

However, for group totals, you need to specify the grouping in your formula. So:

Sum ({Quoted_Items.Total Price},{Job}) - Sum ({Actual_Materials.Cost},{Job})

As far as the detail total, you wouldn't put this formula in details, because the Total Price for each line is going to be the field value of Total Price. No summation necessary.

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top