Here's the SQL that runs the Distributor/Product grouping:
SELECT "AgdataView"."Distributor Name", "AgdataView"."Agdata Product Name", "AgdataView"."Sales_Quantity", "AgdataView"."Sales_Dollars", "AgdataView"."Invoice_Date"
FROM "Agdata"."dbo"."AgdataView" "AgdataView"
WHERE "AgdataView"."Distributor Name"='FERTIZONA'
ORDER BY "AgdataView"."Distributor Name", "AgdataView"."Agdata Product Name"
Here's an example of one of the custom formulas to print sales for a specific year using invoice date:
if {AgdataView.Invoice_Date} >= CDateTime (2008, 01, 01, 00, 00, 00)
and {AgdataView.Invoice_Date} <= CDateTime (2008, 12, 31, 00, 00, 00)
then {AgdataView.Sales_Dollars}
I would like to use an SQL Expression (not a subreport) that would group by Product only, then summarize sales so that I can compare Distributor/Product sales to Total Company Product sales on the same line for indexing purposes. I need to compare Distributor performance by Product to Company performance by Product. Thanks for the help!