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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count problem...

Status
Not open for further replies.

GIScrew

MIS
Joined
Nov 25, 2003
Messages
35
Location
US
I need to count the number of bank loans per census tract id within a certain indate period. The indate field contains a "Y" for yes in date and " " for not indate. The unique id for each loan is a census tract id and there are multiple loans for each census tract id which means duplicate census tract ids but each loan is different. I am trying to use the count (fld,condfld) but Crystal is giving me an error or needing a group that matches. Can someone point me in the right direction? i know i am missing something in order for Crytstal to only count the "Y", indate, loans. Do I need to group the indate loans?
Thanks,
GIScrew
 
condfld is an unfortunate name. Crystal should have called it "GroupBy" or something similar. That 2nd argument controls at what group level the total would be computed.

One option is for you to create a Running Total of type count and an evaluate condition that restricts the count to only cases where you have a "Y" in that field.

Another option is to create a formula that returns a 1 for a "Y" and a 0 otherwise. Then, simply sum it at the desired group level(s).

Cheers,
- Ido


CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Group by census tract id.
Create a formula to count the "Y"'s at the detail level.
Code:
if {table.census_tract_id} = "Y" then
    1
else
    0
Now create a summary off of this formula for the census tract id group.

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top