Results 1 to 6 of 6

Thread: Sum by Date

  1. #1
    New Member
    Join Date
    Sep 12
    Posts
    7

    Sum by Date

    I am relatively new to Crystal however I am pretty far along on what I want to achieve. I have created several formulas and have them working properly. I am currently trying to have several sums based on several different time periods for a field.

    So I have a formula to get the value for the field based off of a input date when the report is ran. Then I made several formulas (one for the first day of each month and one for the last day of each month) so I could have the ranges auto populate based off of those fields.

    Here is a look at structure for 11 months back range

    @11BackBeg Gives first day of the month
    Code:
    Local DateTimeVar d := {TimeRecord.ActualDateTime};
    DateSerial(Year(d), Month(d) - 0 - 11, 1)
    @11BackEnd Gives last day of the month
    Code:
    Local DateTimeVar d := {TimeRecord.ActualDateTime};
    DateSerial(Year(d), Month(d) - 0 - 10, 0)
    @11Back Time puts them into a usable formula
    Code:
    {TimeRecord.OwnedBy} = {?AS Team Member} and
    {@ActualDate} in {@11BackBeg} to {@11BackEnd}
    Now I need to display the proper info using @11Back Time
    I know I need to use Sum but I am unsure how to incorporate the @11Back Time into it.
    Code:
    Sum ({@F AdminTime}, {TimeRecord.OwnedBy})
    Suggestions?

  2. #2
    New Member
    Join Date
    Sep 12
    Posts
    7

    Re: Sum by Date

    Any help or direction with this is appreciated. Even if it is just saying it is not possible.

  3. #3
    New Member
    Join Date
    Sep 12
    Posts
    7

    Re: Sum by Date

    Code:
    If {@ActualDate} in {@11BackBeg} to {@11BackEnd}
    Then Sum ({@F Total Admin}, {TimeRecord.OwnedBy})

    Trying the above but it is only returning zeros, is this any closer than before?

  4. #4
    Frenzied Member
    Join Date
    Sep 05
    Location
    Modesto, Ca.
    Posts
    1,592

    Re: Sum by Date

    Have you tried posting here, http://scn.sap.com/community/crystal...ype~objecttype[thread]
    or Maybe if you explain more about the report and what your trying to achieve, someone can help you find another solution.

  5. #5
    New Member
    Join Date
    Sep 12
    Posts
    7

    Re: Sum by Date

    I hadn't tried posting there yet.

    What this report currently does is: I input a date start and end as well as select which team members I want the specific info for. Then the report gets all of their productivity for that period (typically last month).

    What I would like this to also do is: Using the dateserial function, automatically put in the same productivity requirements for each prior month. Giving me a 12 month trend so I don't have to run the report and print it 12 times.

    So my thought was to create several of the date serial formulas- one for the first day of each month prior and one for the last day of each month prior. Then create a sum formula that would get me the required info for each of the date ranges and have it display on a chart along with the current month info.

    Does this make sense?

  6. #6
    Frenzied Member
    Join Date
    Sep 05
    Location
    Modesto, Ca.
    Posts
    1,592

    Re: Sum by Date

    Sort of makes sense. Beyond what I can help you with. Have you thought about filtering the data before sending it to the report. Don't know what your datasource is or how your setting it, you could use a dataset as the datasource and then only load what you want to print in the dataset. Just a thought.

Posting Permissions

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