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

Grouping and sum on a few fields.... 1

Status
Not open for further replies.

goldfishhh

IS-IT--Management
Jul 23, 2008
23
0
0
US
Ok, I'm stumped. I'm grouping by week and want to get a sum for TD1OZ, TD2OZ and TD3OZ broken out by PreHH and PostHH.

I'm just having a hard time wrapping my brain around how to sum these totals. I can sum for all of TD1OZ, but can't figure it out how to break it out.

(then for extra credit, how would I calculate the difference by week for preHH and PostHH for each type - TD1OZ, TD2OZ and TD3OZ)

Here is the data:

DATE NAME TD1OZ TD2OZ TD3OZ PrePost ReportNumber State
1/1/2009 PR2573IL 758286 1515 204 PreHH 2573 Illinois
1/2/2009 PR2573N 38737 19 1 PreHH 2573 New Mexico
1/3/2009 PR2573O 61945 44 7 PreHH 2573 Oklahoma
1/4/2009 PR2573T 467032 569 82 PreHH 2573 Texas
1/5/2009 PO2573IL 524924 21543 1308 PostHH 2573 Illinois
1/6/2009 PO2573N 28964 264 8 PostHH 2573 New Mexico
1/7/2009 PO2573O 47058 428 21 PostHH 2573 Oklahoma
1/8/2009 PO2573T 329513 10716 528 PostHH 2573 Texas
1/9/2009 PR2568IL 180527 735 98 PreHH 2568 Illinois
1/10/2009 PR2568N 1406 2 0 PreHH 2568 New Mexico
1/11/2009 PR2568O 22523 15 0 PreHH 2568 Oklahoma
1/12/2009 PR2568T 22876 27 2 PreHH 2568 Texas
1/13/2009 PO2568IL 128250 3165 560 PostHH 2568 Illinois
1/14/2009 PO2568N 1120 5 0 PostHH 2568 New Mexico
 
Create six running totals, e.g., sum of TD1OZ, evaluate using a formula:

{table.prepost} = "PreHH" //use PostHH in the second rt for TD1OZ

Reset on change of the date group (weekly). Repeat for the other two fields to sum. Place the rts in the weekly group footer. For the difference just create a formula for each TD column that references the rts you created:

{#TD1OZ-PostHH} - {#TD10Z-PreHH}

-LB
 
Well, well, well... now there is a feature in Crystal I haven't ever used.

Works like a charm!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top