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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Totals 1

Status
Not open for further replies.

webpager

Programmer
Joined
Mar 27, 2001
Messages
166
Location
GB
Part of my app. involves ordering timber by length. As various jobs are added to the worklist the required timber is added to an order table. Each seperate order item is entered into a new record. In addition to the order function, the resulting table provides a visual log of ordering activity.
At the end of the week, the table contains all the items which require ordering from suppliers but as many of the records are for the same kind of timber I am left with a long list of the same timber in different lengths.
ie.
Timber 1 400m
Timber 2 300m
Timber 2 300m
Timber 2 450m
Timber 2 400m
Timber 3 200m
Timber 3 500m
etc.
How can I total each individual type of timber yet keep the different types seperate.
ie.
Timber 1 400m
Timber 2 1450m
Timber 3 700m

Thanks in anticipation
Keith
 
webpager

Use the groups.

Modify your report, from the menu Report->DataGrouping. And group your records by Timber number. Which will add a footer and a header to the group. In the footer add the minute field and in the properties othe field go to the calculations and select sum. And make sure it set to reset itself at every group change. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Keith,

I should try

CALCULATE SUM(length) TO x FOR timbertype="Timber 1"

repeated for all the various timber types if there aren't too many of them. If there are lots, I'd gather all the names into a subsidiary table first using something like

SELECT MainTable
SCAN
IF SEEK(timbertype,SubsidiaryTable)
LOOP
ENDIF
SELECT SubsidiaryTable
APPEND BLANK
REPLACE timbertype WITH MainTable.timbertype
SELECT MainTable
ENDSCAN

and then SCAN through this, doing the calculation each time.

SELE SubsidiaryTable
SCAN
REPLACE length WITH 0
SELE MainTable
CALCULATE SUM(length) TO x FOR timbertype=SubsidiaryTable.timbertype
REPLACE length WITH x
SELE SubsidiaryTable
ENDSCAN

Tony Ayres


 
Thanks Mike
I have been experimenting on those lines but how do I reset the value after each Timber type?

Tony
Thanks for the suggestion.
I was thinking that I would have to create a new table/cursor to get the required data.
Much simpler in a Report if it is possible
 

Thanks Mike
I have been experimenting on those lines but how do I reset the value after each Timber type?


It should be set to reset itself after every timber type, it was just a caution. When you are in the properties of the field->calculations->sum there is a combobox on that page that you cna change that setting.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Thanks Mike
Got it, bit confusing but selecting the field name in the reset box did the trick.
I`m cooking with gas now
Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top