Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2007
    Posts
    7

    Unanswered: Complex Question

    May not be too complex for someone else, but here's what I need to do.

    I have a set of data I'm grouping on Customer, and am trying to figure out a way to find out if item y appears after item x within that group. The tricky part is that item y can also come before item x, but I only care if it comes after. So here's what my data looks like:

    Data within the group is sorted by date)

    Customer Number 123
    Date Item Y
    Date Item X
    Date Item Y
    Date Item Z

    Customer Number 456
    Date Item Y
    Date Item X
    Date Item Z

    So for Customer Number 123 I'd want the formula to return a 1 or a yes or whatever, but for Customer Number 456 I wouldn't want anything returned since no Item Y comes after Item X

    Any help is greatly appreciated.

  2. #2
    Join Date
    Sep 2007
    Posts
    7
    Here's what I've done so far. I created a running total to count Item x, have this total in every row of the report and at the group level, total resets itself on each group.

    Then I have a formula, on every record, that basically says if the running total (above) is greater than 0 and this row is item y, then stamp eith a 1.

    All that works great, and when I unhide the details section I can see it's working correctly. So that leaves one last step, which Crystal apparently does NOT support. I need to know at the group level what the total of that formula I created above is. However, when I go to create a running total at the group, the formula field is NOT one of the fields I can choose to total, likely because it's also based on a total...

    So it's the very last piece that I'm stuck on.

  3. #3
    Join Date
    Mar 2008
    Location
    East Anglia
    Posts
    7
    There is an option when setting up the Running total to 'Evaluate at change of Group' + chose reset at change of group.

    If you then place the Running total summary field (which summarises the 0 or 1 stamped field) in the group footer you should get the required result. It worked for me even when the details section was hidden.

Posting Permissions

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