I think an array could solve the problem for summary fields 'by item'...
Source Data:
"Event 1"
"Event 2"
"Event 3"
Multiple instances of these occur different zones (Group1), and different dates (Group2) so on any given day I report out:
Day 1
"Event 1" - 2 occurences
"Event 3" - 3 occurences
Day 2
"Event 1" - 5 occurences
"Event 3" - 7 occurences
Easy enough to total, keep track of by day but now I want to include grand totals for each specific Event Type at end of report. Thinking if I create an array to count each time a record hits for each event, can just spew them out at end of report in cumulative fashion.
EventArray with key "Event 1" increment each time record is "Event 1" EventArray with key "Event 2" increment each time record is "Event 2"
So on and so forth...
Just not sure where to put; how to code...has to be some variation of the below but just not quite sure:
//Build
WhileReadingRecords;
Local StringVar Key := "" & {Customer.EventType};
Local NumberVar Amt := "Count of Event Types";
StringVar array Keys;
NumberVar Array Amts;
if not(Key in Keys) then
( redim preserve Keys [count(Keys)+1];
redim preserve Amts[count(Keys)+1];
Keys[count(Keys)]:= Key;
Amts[count(Keys)]:= Amt );
Amts [1]
In something like perl it's easy enough to do with a hash but not sure how/where to do it in Crystal.
In the end I'd guess the array to look something like:
ArrayName["Event 1"] = 17 or however many times a record had "Event 1" in the field Customer.EventType
ArrayName["Event 2"] = 18 or however many times a record had "Event 2" in the field Customer.EventType
I dunno...