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

Calculating Freight only once for a P.O.

Status
Not open for further replies.

RobbieB

Technical User
Apr 25, 2003
215
US
Hi,I am using Crystal XI with windows XP Professional.
I have written a report that groups by Department then PO# (Purchase Order #). A manager can have items from multiple Departments on one PO. Freight is a summary field for the entire PO. So, if I try calculating freight and a PO# shows up under "Accessoies" and then again under "Headwear" the freight is calculated twice. I am trying to come up with a way to only add the shipping once when a PO is repeated under a different Department. I started with a running total that turned into trying to use an array which has lead to me being stumped..any ideas would be appreciated.
 
This actually is a sub report summarizing the main reports data by Department.
 
Where are you calculating the freight? Couldn't you use a calculation in the group footer that uses:

maximum({table.freight},{table.PO})

-LB
 
No, there is freight for every purchase order. There are many purchase orders. Items from the same purchase order will show up under different Departments. The freight is calculated for the entire purchase order. the Groups are like this (at the request of the manager)
GRP 1 - Location
GRP 2 - Department
Grp 3 - Purchase Order
Details

The est_freight is in group footer 3. ex - PO # 2304 has a bracelet and a hat ordered. the bracelet will show up under the department "Accessories" and the hat will show up under the department "headwear" the est_freight for PO# 2304 is $19.95. $19.95 will show up for the PO #2304 in the Accessories department and for PO2304 in the Headwear department. I need to be able to say if the est_freight for po# 2304 has already been added to the running total than add 0 else add the est_freight.
 
Please explain your main report structure and your subreport structure, and where your subreport is located. I can't tell what's what. If the department group is only in the subreport, couldn't you then calculate the freight in the main report (where PO maybe is all in one place, and then pass it via a shared variable to the subreport? a wild guess only.

-LB
 
The main report groups differently so the freight can be calculated accurately. Because it groups By
GRP 1 - Location
GRP 2 - Vendor
GRP 3 - PO #

there is ONLY 1 VENDOR FOR EACH PO

The sub report was intended to show the manager how much they order for each department. There are multiple departments available from each vendor. Therefore, each PO can have items ordered from multiple Department.
the sub report groups like this

GRP 1 - Location
GRP 2 - Department
GRP 3 - PO (the same po will show up under multiple departments)


Here is an example

ClubHouse //location
Accessories //Department
4453 - est shipping $19.95 // PO this field is
suppressed and summarized
in the Accessories GRP 2
footer.
4293 - est shipping $24.95
etc......

Headwear // Department - same location
4453 - est shipping $19.95 //repeating est shipping
because it is the same sales order as the one
that showed up in the accessories section and
est shipping is the total shipping for that
sales order not broken out by each individual
product.
 
Where is your subreport located in the main report, and how is it linked?

-LB
 
I ended up cheating and created another sub report that was just grouped by PO and created sum's for the freight, etc and aligned it with the other sub report so it looked like ti was totalling in the same report. Thanks for all of your help and sorry for the confusion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top