Hello
I am using Crystal 9.0 and I've never created an array before.
The report has 3 groups: catchment_area, hospital region and hospital. I want to create a summary statement in the report footer indicating what % of a certain region is treating a certain catchment area.
To start, I'm just trying to get at volumes per catchment area of which there are 2: Primary and Secondary. Using the formula below it results in 0 but if I query for Secondary Catchment Area it shows the correct amount, I believe because Secondary is the last group. So maybe this needs looping (which I don't know how to do):
Any and all assistance greatly appreciated. Thanks.
I am using Crystal 9.0 and I've never created an array before.
The report has 3 groups: catchment_area, hospital region and hospital. I want to create a summary statement in the report footer indicating what % of a certain region is treating a certain catchment area.
To start, I'm just trying to get at volumes per catchment area of which there are 2: Primary and Secondary. Using the formula below it results in 0 but if I query for Secondary Catchment Area it shows the correct amount, I believe because Secondary is the last group. So maybe this needs looping (which I don't know how to do):
Code:
whileprintingrecords;
numbervar primcatch_ttl:=0;
stringvar array catch;
redim catch[2];
catch[1]:="Primary Catchment Area";
catch[2]:="Secondary Catchment Area";
if {@Catchment}=catch[1] then primcatch_ttl:=Sum ({DAD.# Dschg}, {@Catchment});
totext(primcatch_ttl,0);
Any and all assistance greatly appreciated. Thanks.