Link to home
Start Free TrialLog in
Avatar of nkuo
nkuo

asked on

Crystal report question - running total? Variable?

Crystal Report 8.5.  I need a report that shows sales data based on customer join date and purchase activity.  Let's say there are 2 tables one containing contact info and the other purchase history joined by contact_id.  I need to show the count of contacts who made purchases within the first year of them becoming a customer, second year, third year etc.  I tried using a running total using and evaluate using a formula that with a datediff calculation and the numbers does not look right.  
Avatar of Mike McCracken
Mike McCracken

Are you looking for the first purchase or do you need all purchases accounted for?
By that i mean if i signed up in July 2004.  Purchases in Oct 2004, Aug 2005, and Dec 2006  
Do you count
   1st year - 1  
   2nd year - 1
   3rd year -1

mlmcc
Can you show how you are counting and the results along with sample data?

mlmcc
Avatar of nkuo

ASKER

only first purchase.  
Sample data would be something like below
contact table
contact_id      Join_date
1      1/1/2004
2      12/23/2005
3      2/29/2007
4      4/2/2006

Order table
order_id      order_date      order_contact_id
1      6/23/2006      1
2      1/21/2007      1
3      12/1/2006      2
4      2/29/2007      3
5      4/5/2006      4

I created an 'purchased within one year'  distinct count running total evaluating
DateDiff ("d", {Contact.Join_Date},Minimum ({Order.Order_Date}, {Contact.Contact_Id}) )  < 365  
would this work?  What is the best way to create the report I want?


Avatar of nkuo

ASKER

report can look something like

      Less than 1year      2 years      after_2year
Total      2                           1       1            
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Glad i could help

mlmcc
Avatar of nkuo

ASKER

Mlmcc. Thank you very much for your help.