I need some help on how to consolidate my formulas. I was thinking I could use CASE but not sure how to put it together.
I'm using Crystal 11.5
Here is an example of two of my formulas. I am then using Print to put them on the report. Everything is working but I have 7 different classes. Then I need to create this same formula for Male/Female and for each Race we have, Black, Hispanic, Asian etc.
Can anyone help me consolidate this formula. If I do each one seperate, I will have about 50 Count and 50 Print formulas.
WhilePrintingRecords;
Numbervar CountApprenticeM;
if ({brptPRWklyCompliance;1.Class} LIKE 'CA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'EA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'FA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'IWA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'KYOA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'LA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'OA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'PDA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'PSA*' AND
{brptPRWklyCompliance;1.Class} <> 'IWAGF') AND
{brptPRWklyCompliance;1.Sex}='M'
then (CountApprenticeM:=CountApprenticeM+1) else 0
WhilePrintingRecords;
Numbervar CountCarpenterM;
if (NOT ({brptPRWklyCompliance;1.Class} LIKE 'C*F*') AND
NOT ({brptPRWklyCompliance;1.Class} LIKE 'CA*') AND
{brptPRWklyCompliance;1.Class} LIKE 'C*') AND
{brptPRWklyCompliance;1.Sex}='M'
then (CountCarpenterM:=CountCarpenterM+1) else 0
WhilePrintingRecords;
Numbervar CountApprenticeM;
CountApprenticeM
WhilePrintingRecords;
Numbervar CountCarpenterM;
CountCarpenterM
I'm using Crystal 11.5
Here is an example of two of my formulas. I am then using Print to put them on the report. Everything is working but I have 7 different classes. Then I need to create this same formula for Male/Female and for each Race we have, Black, Hispanic, Asian etc.
Can anyone help me consolidate this formula. If I do each one seperate, I will have about 50 Count and 50 Print formulas.
WhilePrintingRecords;
Numbervar CountApprenticeM;
if ({brptPRWklyCompliance;1.Class} LIKE 'CA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'EA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'FA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'IWA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'KYOA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'LA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'OA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'PDA*' OR
{brptPRWklyCompliance;1.Class} LIKE 'PSA*' AND
{brptPRWklyCompliance;1.Class} <> 'IWAGF') AND
{brptPRWklyCompliance;1.Sex}='M'
then (CountApprenticeM:=CountApprenticeM+1) else 0
WhilePrintingRecords;
Numbervar CountCarpenterM;
if (NOT ({brptPRWklyCompliance;1.Class} LIKE 'C*F*') AND
NOT ({brptPRWklyCompliance;1.Class} LIKE 'CA*') AND
{brptPRWklyCompliance;1.Class} LIKE 'C*') AND
{brptPRWklyCompliance;1.Sex}='M'
then (CountCarpenterM:=CountCarpenterM+1) else 0
WhilePrintingRecords;
Numbervar CountApprenticeM;
CountApprenticeM
WhilePrintingRecords;
Numbervar CountCarpenterM;
CountCarpenterM