Results 1 to 5 of 5

Thread: CR Formula Question

  1. #1

    Thread Starter
    Addicted Member TheGoldenShogun's Avatar
    Join Date
    Mar 2001
    Location
    VA/MD... anywhere around the beltway
    Posts
    236

    Cool

    I don't know if anybody is really familiar with Crystal Reports Formula Generation, but I'll give this a shot.

    I have a report, it displays a list of different cities in the United States and the cities are organized and group by state. (IE Charlotte, followed by Raleigh are under North Carolina). Now then, I have a total for each city listed next to that city, seperate by year. Like so..

    NORTH CAROLINA
    Charlotte 10,000
    Raleigh 20,000

    TOTAL FOR NC - 2001 XXXXXXX

    Charlotte 15,000
    Raleigh 5,000

    TOTAL FOR NC - 2002 XXXXXXX

    My problem is I can't seem to work the formula section right to generate just the total for that specific state in that specific year. I have all 50 states listed and when I try to get the sum of that Program Amount Field, I get the total for the entire united states instead of just that state. Can anybody give me a hand?

  2. #2
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621
    I did something similar a while ago and the way I did it was to create a group by State in your case and then a total for the state in that group.

    Don't know if this of any use to you.
    Gary Lowe
    VB6 (Enterprise) SP5
    ADO 2.6
    SQL Server 7 SP3

    OK I know my spelling and grammer is crap so don't quote me on it!

    To err is human to take the P! is only natural !!

    Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip


  3. #3
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Gary's right, you'll need to create a group for the states.

    Insert menu > group

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  4. #4

    Thread Starter
    Addicted Member TheGoldenShogun's Avatar
    Join Date
    Mar 2001
    Location
    VA/MD... anywhere around the beltway
    Posts
    236
    Oh no, I have the Group Sections for both the State and the Year. My report looks perfectly fine, I just can't get the subtotals for the particular State at a particular Year. You guys are saying get the total for the group, what I am doing is inserting a Formula Field and trying to use the Sum() function for that Program Amount field. That's just returning the Sum of all the Program Amount's and supplying them all to me.

  5. #5

    Thread Starter
    Addicted Member TheGoldenShogun's Avatar
    Join Date
    Mar 2001
    Location
    VA/MD... anywhere around the beltway
    Posts
    236

    Cool

    I got it, I just right clicked on the Program Amount field and said, Insert Subtotal. Thanks for the help.

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