I am a fairly new user to Crystal and I'm creating a summary report that keeps track of the number of orders received for a particular credit card. I created the first couple of columns using running totals and I inserted summaries to display the percentage of usage by credit card. That part was pretty simple for the first percentage because there isn't a condition in my running total so I was able to duplicate what the running total was doing by using a summary and displaying as a percentage. But this is where the difficult part comes in. Some of the columns have formulas in the running totals and I'm unable to create summaries for these columns because you can't enter formulas when using summaries. now I'm trying to figure out how to write a formula that will similate what the running total is doing but add the additional condition in it. If I was able to write SQL to get the answer I would code a simple statement as follows:
Select distinct(a.res_nbr)
from table a, table b
where a.res_nbr = b.res_nbr
and b.fraud_type = 211
Is there a way to use the distintCount function in Crystal to get this answer?
I tried to write this function and I received an error:
NumberVar chgbckcnt := DistinctCount{CHARGE_BACK.RES_NBR}) where fraud_type = 211
if chgbckcnt <> 0
then
({#RTchgBck} / chgbckcnt ) * 100
else
0
Select distinct(a.res_nbr)
from table a, table b
where a.res_nbr = b.res_nbr
and b.fraud_type = 211
Is there a way to use the distintCount function in Crystal to get this answer?
I tried to write this function and I received an error:
NumberVar chgbckcnt := DistinctCount{CHARGE_BACK.RES_NBR}) where fraud_type = 211
if chgbckcnt <> 0
then
({#RTchgBck} / chgbckcnt ) * 100
else
0