Notices


Reply
 
LinkBack Thread Tools Display Modes

Old 03-11-2008, 11:55 AM   #1 (permalink)
my feet hurt.

Melissa Siobhan's Avatar

Join Date: May 2006
Location: Connecticut
Posts: 1,452
Rep Power: 4 Melissa Siobhan is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)

Count function

when I tried to use this expression

count ({CnBio.CnBio_ID},{@Projected FY2008},>0)

i get an error saying that a number, boolean, date, time, date-time, or string is expected here.

What is wrong?

I want a count of all constituents whose Projected Amount is greater than 0
__________________
Melissa S. Graves

Director of Development Services
The Village for Families and Children
www.villageforchildren.org



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Old 03-11-2008, 12:00 PM   #2 (permalink)
Crystal Reports Guru

DrewAllen's Avatar

Join Date: May 2006
Location: Philadelphia, PA
Posts: 1,155
Rep Power: 4 DrewAllen is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)
- Information Edge (TIE)
- API/VBA

Quote:
Originally Posted by Melissa Siobhan View Post
when I tried to use this expression

count ({CnBio.CnBio_ID},{@Projected FY2008},>0)

i get an error saying that a number, boolean, date, time, date-time, or string is expected here.

What is wrong?

I want a count of all constituents whose Projected Amount is greater than 0

Try
Code:
count ({CnBio.CnBio_ID},{@Projected FY2008}) >0
instead. You're paren was in the wrong place.

Drew
__________________
J. Drew Allen
Children's Hospital of Philadelphia

Crystal Reports and SQL Server Consultant

It is better to live your destiny imperfectly than to live an imitation of somebody else's life with perfection.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Old 03-11-2008, 12:04 PM   #3 (permalink)
my feet hurt.

Melissa Siobhan's Avatar

Join Date: May 2006
Location: Connecticut
Posts: 1,452
Rep Power: 4 Melissa Siobhan is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)

When I tried that I got an error simply stating

"The summary/running total field could not be created"
__________________
Melissa S. Graves

Director of Development Services
The Village for Families and Children
www.villageforchildren.org



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Old 03-11-2008, 12:54 PM   #4 (permalink)
Crystal Reports Guru

DrewAllen's Avatar

Join Date: May 2006
Location: Philadelphia, PA
Posts: 1,155
Rep Power: 4 DrewAllen is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)
- Information Edge (TIE)
- API/VBA

This function requires a group on the second parameter. The error message you're getting indicates that this group doesn't exist. How you get what you want depends on the definition of {@Projected FY2008} and whether you are using Crystal XI or Crystal 8.5.

Drew

P.S. I won't be able to respond immediately, because we have a number of things that we are working on right now and work does take precendence.
__________________
J. Drew Allen
Children's Hospital of Philadelphia

Crystal Reports and SQL Server Consultant

It is better to live your destiny imperfectly than to live an imitation of somebody else's life with perfection.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Old 03-11-2008, 07:51 PM   #5 (permalink)
Senior Member

Join Date: Sep 2006
Location: Boston, MA
Posts: 124
Rep Power: 3 stancliff is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)
- Information Edge (TIE)

To further expand on what Drew explained:

If you are using this:
Code:
count ({CnBio.CnBio_ID},{@Projected FY2008}) >0
then there must be a grouping in the report that is based on @Projected FY2008.

I'd be interested to see what the formula is for @Projected FY2008 and know if the report groups on it.

I only have experience with Crystal XI, so I can't speak to Drew's knowledge of what happens in 8.5.
__________________
Brian A. Zive
Information Systems Manager
Massachusetts General Hospital
Development Office
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Old 03-12-2008, 09:19 AM   #6 (permalink)
my feet hurt.

Melissa Siobhan's Avatar

Join Date: May 2006
Location: Connecticut
Posts: 1,452
Rep Power: 4 Melissa Siobhan is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)

This is the code for {@Projected FY2008} (fields are from the proposal tab)

If {CnPrProp_1.CnPrProp_1_Status} in
("01 Suspect,02 Prospect,03 Strategy,04 Cultivation,05 Ready,06 Considering") then
(If IsNull({CnPrProp_1.CnPrProp_1_Date_Funded})
then

(If IsNull({CnPrProp_1.CnPrProp_1_Date_Expected})
then 0
else

(if {CnPrProp_1.CnPrProp_1_Date_Expected}
in CDate(2007, 07, 01) to CDate(2008, 06, 30)
then {@Probable Amount}
else
if {CnPrProp_1.CnPrProp_1_Date_Expected}
< CDate(2007, 07, 01)
then 0
else
if {CnPrProp_1.CnPrProp_1_Date_Expected}
> CDate(2008, 06, 30)
then 0))

else 0)
else 0

I am not grouping on this field but I want a count of those who have something other than 0 next to the summary field I have for this field in my group footer (Grouped by {CnPrProp_1.CnPrProp_1_Solicitors})
__________________
Melissa S. Graves

Director of Development Services
The Village for Families and Children
www.villageforchildren.org



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Old 03-12-2008, 04:50 PM   #7 (permalink)
Crystal Reports Guru

DrewAllen's Avatar

Join Date: May 2006
Location: Philadelphia, PA
Posts: 1,155
Rep Power: 4 DrewAllen is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)
- Information Edge (TIE)
- API/VBA

Quote:
Originally Posted by Melissa Siobhan View Post
This is the code for {@Projected FY2008} (fields are from the proposal tab)

If {CnPrProp_1.CnPrProp_1_Status} in
("01 Suspect,02 Prospect,03 Strategy,04 Cultivation,05 Ready,06 Considering") then
(If IsNull({CnPrProp_1.CnPrProp_1_Date_Funded})
then

(If IsNull({CnPrProp_1.CnPrProp_1_Date_Expected})
then 0
else

(if {CnPrProp_1.CnPrProp_1_Date_Expected}
in CDate(2007, 07, 01) to CDate(2008, 06, 30)
then {@Probable Amount}
else
if {CnPrProp_1.CnPrProp_1_Date_Expected}
< CDate(2007, 07, 01)
then 0
else
if {CnPrProp_1.CnPrProp_1_Date_Expected}
> CDate(2008, 06, 30)
then 0))

else 0)
else 0
I know you didn't ask about this, but you don't really need to account for every single possible combination of values. If your record doesn't meet any of the criteria, it will produce a zero, so you don't need to specify those cases. In some cases, a Null value can be treated as being equivalent to a zero, so you may not even need to worry about cases that would produce a Null value. You can also use AND and OR to make complex logical statements instead of looking at every field independently. You only have one case where you need to produce something different from Null or zero, so you can greatly simplify this to only consider that one situation.
Code:

If {CnPrProp_1.CnPrProp_1_Status} in
        ["01 Suspect","02 Prospect","03 Strategy",
         "04 Cultivation","05 Ready","06 Considering"]
    AND IsNull({CnPrProp_1.CnPrProp_1_Date_Funded})
    AND {CnPrProp_1.CnPrProp_1_Date_Expected} in CDate(2007, 07, 01) to CDate(2008, 06, 30)
then {@Probable Amount} 
If the CnPrProp_1_Status is Null, it will produce a Null result which is fine. If it's not in your list, then it will produce a zero result, which is also fine.

If the CnPrProp_1_Date_Funded is not Null, it will produce a zero result, which is fine.

If the CnPrProp_1_Date_Expected is Null, it will produce a Null result, which is fine. If it's not in your current fiscal year, it will produce a zero amount, which is fine.

Tying two threads together, you may want to use a formula similar to the {@Gift FY} to calculate the {@Date Funded FY} and compare that to the {@Current FY}, instead of hard-coding the dates for this FY.

Now, to finally get to your original question, it depends on whether you are using Crystal 8.5 or Crystal XI. In both, you can use a running total and the "Use Function" for the evaluation (tying in yet another thread) to create a "distinct count" of donors where the {@Projected FY2008} > 0.

There is another--better--option in Crystal XI. First create a formula {@Null String}
Code:
//leave this section blank
That's right!! Do not enter anything in the formula. Then create a second formula
Code:
If {@Projected FY2008} > 0 Then {Constituent ID field} Else {@Null String} 
If {@Projected FY2008} is Null or zero, this will produce a Null, which is exactly what you want, otherwise it will output the Constituent ID. If you use the Constituent ID, you can use the {@Null String} as is, because the Constituent ID is a string field, but if you use the System Record ID or some other numeric ID, you'll need to convert the {@Null String} to a number.

Once you have this second formula, you can do a distinct count on that formula.

I know that was a LOT of information. I hope you're not overwhelmed by it.

Drew
__________________
J. Drew Allen
Children's Hospital of Philadelphia

Crystal Reports and SQL Server Consultant

It is better to live your destiny imperfectly than to live an imitation of somebody else's life with perfection.

Last edited by DrewAllen; 03-12-2008 at 04:52 PM. Reason: changed an "is null" to an "is not null"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
count


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Cheap Gas - Cheap Gas - Internet Marketing - Credit Counseling
All times are GMT -6. The time now is 04:15 AM.

Miscellaneous


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by BBpixel Team 2008 :: jvbPlugin R1012.364.1

SEO by vBSEO 3.2.0 Copyright 2008 Blackbaud User SocietyAd Management by RedTyger
Inactive Reminders By Icora Web Design

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64