Crystal Report, Group Item sold from first invoice date for first 3 months

SOLVED

Hi,

I need some help on how i can do this in crystal report, I would like to get each item number and based on their first invoice transaction, i would like to get the quantity sold for the first month, second month and third month in columns.

For example: 

Item Number: "A" first invoice sold in 3/15/2022,

The output would be:

Columns: Item No: A, First Month Qty Sold: 3, Second Month Qty Sold: 80, Third Month Qty Sold: 50

Basically i need to find out how many we sold during the first 3 months since the first transaction of each item number.

Thank you!

Parents
  • 0

    That's going to be a super slow report, even restricted to displaying 3 months per item.  (The data can't be pre-filtered at the report selection stage).

    Try using IM_ItemCustomerHistoryByPeriod data (by period, so it should be faster than raw invoice history)... grouped by item, with formulas for FirstMonthQuantity (in relation to the minimum date per item), SecondMonthQuantity, and ThirdMonthQuantity...  to sum for your three totals.

    I usually do an "IsFirstMonthForThisItem" for the logic test (dragged into the report to verify the formula works as you want), then do the quantity formula using that True/False value (if IsFirstMonthForThisItem then quantityfield else 0).

Reply
  • 0

    That's going to be a super slow report, even restricted to displaying 3 months per item.  (The data can't be pre-filtered at the report selection stage).

    Try using IM_ItemCustomerHistoryByPeriod data (by period, so it should be faster than raw invoice history)... grouped by item, with formulas for FirstMonthQuantity (in relation to the minimum date per item), SecondMonthQuantity, and ThirdMonthQuantity...  to sum for your three totals.

    I usually do an "IsFirstMonthForThisItem" for the logic test (dragged into the report to verify the formula works as you want), then do the quantity formula using that True/False value (if IsFirstMonthForThisItem then quantityfield else 0).

Children