Results 1 to 5 of 5

Thread: Sum a formula field [RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Sum a formula field [RESOLVED]

    Hello everybody,

    I have a formula field which shows sum of a database field against year and shows records arranged in a group. At the end of each group, I need to show sum of the formula field.

    Example:

    Mr. ABC
    2005 $100
    2006 $200
    --------------
    $300

    Mr. XYZ
    2005 $500
    2006 $600
    --------------
    $1100

    I am unable to show $300 and $1100 and Price is formula field and crystal report does allow me to summarize this field.

    Thanks.
    Last edited by usamaalam; Sep 29th, 2005 at 12:13 AM.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Sum a formula field

    The summary options available on a Formula field depend on its return value.

    If Crystal is not giving you the option to "Sum" then the formula's return value is not numeric. Post the formula.

  3. #3

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: Sum a formula field

    This is the formula called forTotal which shows amount in Dollars.
    VB Code:
    1. Sum ({Maintenance_ComplaintDetail.Charges}, {@Year})
    Another formula called Year is :
    VB Code:
    1. Dim strArray() As String
    2. strArray = Split(CStr({Maintenance_Complaint.OrderStartDate}),"-")
    3. Formula = year(cdate(Left(strArray(3),2) & "/" & strArray(2) & "/" & strArray(1)))

    Thanks.

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Sum a formula field

    You cannot Sum a Sum.

    Create a new formula for the customer total.
    Sum ({Maintenance_ComplaintDetail.Charges}, {Your customer group field})

  5. #5

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: Sum a formula field

    Thanks. Problem is resolved. I sum the field against first group.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width