Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3464
  • Last Modified:

Need Help with Sum(fld, condFld, cond)

Hi,

I'm pretty new with CR8.5 put I still know a little bit how to use it...

I have a list of Donors and a list of Pledges.

1 Donor can have many pledges.

Here's how my DB looks like :

DONOR       TYPE          CODE         AMOUNT
Donor1       Pledge        Verbal         1000
Donor1       Pledge        PG               5000
Donor1       Pledge        Verbal         2000
Donor1       Pledge                          4000
Donor2       Pledge        Verbal         3000
Donor3       Pledge                          1000
Donor3       Pledge                          2000
...

I would like to have a formula that would add the amounts depending of the Code for each donors.

My understanding is that : SUM({Gift.GiftAmount},{Gift.Code}."Verbal") should work but it doesn't.....

I'm trying to do a formula that would SUM the amount of all the pledges with the same codes for each donors....
Regular Pledges have no codes.

So my result should look like :


Donor1      TotalVerbal        TotalPG       TotalRegular
Donor2      TotalVerbal        TotalPG       TotalRegular
Donor3      TotalVerbal        TotalPG       TotalRegular

Can anybody help me ???
0
LosJee
Asked:
LosJee
3 Solutions
 
ebolekCommented:
ok you use grouping for these

insert 2 groups : First is donor, second is code

Then put running totals on the amounts for the both group footers
On chnage of for donor group is donor
summary
reset at the chnage of group

Also put another running  total on the code group footer as well. Same logic. you will egt the totals for each donor and each code

0
 
frodomanCommented:
I agree with Emre.  Create your two groups as he says.  I would create the running totals and drag them into the Group #1 header and then suppress everything related to group #2 -- this will give you the display you want (single row for each donor).

frodoman
0
 
bdreed35Commented:
You can only use that version of the sum function when you are grouping on a date or a boolean field.

Another option that I tend to use more often than Running Totals is a simple formula to evaluate for each record:

If {Gift.Code} = "Verbal" then
    {Gift.GiftAmount}
Else
    0

You can then insert a summary off of this formula for your Donor grouping.  I like this method because I can easily put a grand total in without having to create formula.  WIth Running Totals you would need to create a seperate Running Total for each subtotal and grand total.
0
 
LosJeeAuthor Commented:
Thank you all !

My problem was a way more complicated than explained but with your help, I was able to do this with groups but also, with some formula fields...

Thanks again !

U guys are the best !!!!!
0
 
ebolekCommented:
Glad to help
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now