Crystal Report: Customer Sales History - Multiple Years, Different Periods

OK, friends!  If either of you can solve this for me, you will be my hero for month! Lol

I have created a custom report that is sorted by Customer Number. Main tables involved are AR_Customer and AR_CustomerSalesHistory.  I need for this ONE report to display the following:

1. Customer # and Name

2. Dollars Sold for Period 11 and 12, 2016 (totaled)

3. Dollars Sold for Period 1 to Date, 2017 (totaled)

4. Grand Total of Dollars Sold (combined) for #2 and #3.

This report would be a running total of Dollars Sold, basically, for Sales History from 11/1/2016 to Present, based on a specific Customer Type. If this is even possible, and you can provide instruction on how to accomplish this, it would be GREATLY appreciated! :)

- T. Helm

Parents
  • 0
    Add formulas:
    YearPeriod: {AR_CustomerSalesHistory.FiscalYear} & {AR_CustomerSalesHistory.FiscalPeriod}
    Period1: if {@YearPeriod} in ["201611","201612"] then {AR_CustomerSalesHistory.DollarsSold} else 0
    Period2: if {@YearPeriod} in ["201611","201612"] then 0 else {AR_CustomerSalesHistory.DollarsSold}

    Record selection formula: {@YearPeriod} >= "201611"

    Period1 gives you #2 and Period2 gives you #3
    For #4 you can simply use DollarsSold, or sum Period1 and Period2.

    The rest should be easy:
    Subtotal by customer and add a grand total for each column.
    Suppress Details and Group Header #1, add CustomerName to Group Footer #1
  • 0 in reply to 49153
    Thanks so much. Ok... I added the formulas, but I don't see Year 2017 anywhere in the mix? I need for it to have a grand total of Periods 11 + 12 for 2016, ADDED to Period to Date 2017. Hope that makes sense. Also, am I "grouping" by Customer #?

    T. Helm
  • 0 in reply to helmt01
    Further...and as an example. We had a customer with sales for Period 11 & 12 (2016) combined totaling $36,110.24. For Period 1 (2017) to Date, they had sales of $18,556.70. Therefore, their total sales for Period 11 & 12 (2016 plus Period 1 (2017) to Date should be $54,666.94 as Dollars Sold. Currently, with the formulas you provided, that total is only showing as $10,500.39...which is the total for Period 1, 2017 only.
  • 0 in reply to helmt01
    The formula for Period2 gives you 2017 YTD.
    Yes you are grouping by customer.
  • 0 in reply to helmt01
    You're confusing me.... you are contradicting what you asked for in your first post.
  • 0 in reply to helmt01
    As a test add 3 formulas:
    if {@YearPeriod} = "201611" then {AR_CustomerSalesHistory.DollarsSold} else 0
    if {@YearPeriod} = "201612" then {AR_CustomerSalesHistory.DollarsSold} else 0
    if {@YearPeriod} = "201701" then {AR_CustomerSalesHistory.DollarsSold} else 0

    See what they kick out and if you agree. They will give you sales for 2016-11, 2016-12 and 2017-01 respectively.
  • 0 in reply to 49153

    Sorry, I don't mean to sound confusing. Thanks for your help. All I can tell you is...I created the formulas as you instructed just like this:

    YearPeriod:  {AR_CustomerSalesHistory.FiscalYear} & {AR_CustomerSalesHistory.FiscalPeriod}

    Period 1: if {@YearPeriod} in ["201611","201612"] then {AR_CustomerSalesHistory.DollarsSold} else 0

    Period 2: if {@YearPeriod} in ["201611","201612"] then 0 else {AR_CustomerSalesHistory.DollarsSold}

    Record Selection:  {@YearPeriod} >= "201611"

    Here is a screenshot of the actual report...AFTER adding/modifying same as you instructed:

    What am I missing?  Again, the total for that customer I mentioned previously SHOULD be larger than what the report is displaying. When I look at total sales for Period 11 & 12, 2016 and Period 1 to Date, 2017, it's not the same total. Thanks!

  • 0 in reply to helmt01
    I don't have your data so I cannot give you insight.
    Go back to my previous reply and try the 3 formulas and see what you get.
Reply Children