Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GETTING A PERCENTAGE OF RECORDS 1

Status
Not open for further replies.

Evil8

MIS
Mar 3, 2006
313
US
Greetings,

I'm progressing in my reporting knowledge, but I'm not yet a master...lol. I have a report like:

LEVEL1 LEVEL2 LEVEL3
EE EE
EESP WAIV WAIV
WAIV
EEF EE

I need percentages of NOT waiv and Not Nulls for each column in the report footer. For example the percentage for LEVEL2 would be 50.0% and LEVEL3 would be 0.0% Can anyone help me with this?
 
To really help, more information is needed.
-what is used to display your data? table fields? formulas? subreports? etc?
-what version of crystal are you using?
-what sort of database are you connecting to?
-more info is very good.

You could create a formula to be placed in the details section that evaluated each record for the criteria you need:

For example...

{@Level1WAIVorNull)
IF (({table.levelfield}=1)AND(isNull({table.field}) or TRIM({table.field})="" OR {table.field}="WAIV"))
then 1
else 0


Then do a sum of the formula and divide by the # of records.
 
ooops, left of the NOTs

IF (({table.levelfield}=1)AND NOT(isNull({table.field}) or TRIM({table.field})="" OR {table.field}="WAIV"))
then 1
else 0
 
fisheromacse - I'm using CRXI, an access 2003 db and the data is coming from querries fields in the database. I'll try your formula it looks like it'll work.
 
Okay I got a count with:

If (({qry_Insured_Health.Level}="EE" Or
{qry_Insured_Health.Level}="EECH" Or
{qry_Insured_Health.Level}="EEF" Or
{qry_Insured_Health.Level}="EESP")
And Not (isNull({qry_Insured_Health.Level})
Or Trim ({qry_Insured_Health.Level})=""
Or {qry_Insured_Health.Level}="WAIV"))
Then 1
Else 0

Now I'll work on the pecentage.
 
Hey thank you very much for your help fisheromacse! I got it working correctly. It takes more steps than I anticipated, but it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top