|
-
May 4th, 2006, 11:01 AM
#1
Thread Starter
Member
[Resolved] Additional group Sum question
I noticed a post which asks about summing and was resolved by simply doing a 'Summary' from the Crystal menu. I have the same problem, but I need one value (which must be in the report) removed from the summary.
For example there's a field:
{Intran.Quantity} which I need summed on a group level, however I need it filtered by the 'Type' field: {Intran.Type}. The report SQL pulls in several 'Type' (IN, CM, RC). I need just the IN and CM types summed on a group level. Just running a summary does give me the correct groupings, but the results are high because the RC's are also included.
Last edited by BIGGY; May 4th, 2006 at 11:39 AM.
-
May 4th, 2006, 11:38 AM
#2
Thread Starter
Member
Re: Additional group Sum question
Welp, just had to change things around a bit, but this seems to do it. I basically had to do the manual grouping in the formula (if someone has a better way to do this let me know). But I didn't rely on the grouping to do anything for me so it's all manual. In the detail level I have this formula:
whileprintingrecords;
numbervar Week1;
numbervar Week2;
numbervar Week3;
numbervar Week4;
numbervar Week5;
if {INTran.TranType} <> 'RC' and {@WeekOfMonth} = 1 and {@ConvertMonth} = month(currentdate) then
Week1 := Week1 + {INTran.Qty};
if {INTran.TranType} <> 'RC' and {@WeekOfMonth} = 2 and {@ConvertMonth} = month(currentdate) then
Week2 := Week2 + {INTran.Qty};
if {INTran.TranType} <> 'RC' and {@WeekOfMonth} = 3 and {@ConvertMonth} = month(currentdate) then
Week3 := Week3 + {INTran.Qty};
if {INTran.TranType} <> 'RC' and {@WeekOfMonth} = 4 and {@ConvertMonth} = month(currentdate) then
Week4 := Week4 + {INTran.Qty};
if {INTran.TranType} <> 'RC' and {@WeekOfMonth} = 5 and {@ConvertMonth} = month(currentdate) then
Week5 := Week5 + {INTran.Qty};
And in the group footer, I have individual formulas for each week that will reset the counter...here's one as an example:
whileprintingrecords;
numbervar Week1;
numbervar DispWeek1;
DispWeek1 := Week1;
Week1 := 0;
DispWeek1;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|