Sales Comparison by Items Report

Hello Experts,
Is there a report in B1 that compares total sales by item between two periods? If not, could anyone help me with a query?
For Example:  Total sales for item A0001 between Jan-Oct 2010 is $10000 and Total sales for item A0001 between Jan-Oct 2009 is $5000
When i enter a date range i should get result like this:
ItemCode ItemDesc Jan-Oct 2010  Jan-Oct 2009
A0001     Printer      $10000             $5000
Praneeth

Updated:
SELECT S.ItemCode, MAX(S.ItemName) as 'Item Description', SUM(S.[2010]) as 'Jan-Oct 2010',SUM(S.[2009]) as 'Jan-Oct 2009'
FROM
(SELECT T0.ItemCode, T0.ItemName, T1.LineTotal AS [2010], 0 AS [2009]
FROM dbo.OITM T0
INNER JOIN dbo.INV1 T1 ON T1.ItemCode = T0.ItemCode AND Year(T1.ShipDate)=2010 and DateDiff(MM,T1.ShipDate,'10/10/2010')>=0
UNION
SELECT T0.ItemCode, T0.ItemName, 0 AS [2010], T1.LineTotal AS [2009]
FROM dbo.OITM T0
INNER JOIN dbo.INV1 T1 ON T1.ItemCode = T0.ItemCode AND Year(T1.ShipDate)=2009 and DateDiff(MM,T1.ShipDate,'10/10/2009')>=0
UNION
SELECT T0.ItemCode, T0.ItemName, -T1.LineTotal AS [2010], 0 AS [2009]
FROM dbo.OITM T0
INNER JOIN dbo.RIN1 T1 ON T1.ItemCode = T0.ItemCode AND Year(T1.ShipDate)=2010 and DateDiff(MM,T1.ShipDate,'10/10/2010')>=0
UNION
SELECT T0.ItemCode, T0.ItemName, 0 AS [2010], -T1.LineTotal AS [2009]
FROM dbo.OITM T0
INNER JOIN dbo.RIN1 T1 ON T1.ItemCode = T0.ItemCode AND Year(T1.ShipDate)=2009 and DateDiff(MM,T1.ShipDate,'10/10/2009')>=0
) S
GROUP BY S.ItemCodeHAVING SUM(ISNULL(S.[2010],0))+SUM(ISNULL(S.[2009],0))> 0

Similar Messages

  • Sales Analisys on Items report in Delivery

    Incorrectly sales analysis report on Items in the context of Delivery Notes, if Delivery has a status - Closed.
    1. Add the document u2013 Delivery №1 with item/service type to the system.
    2.We want to see the sales analysis report. Sales -> Sales reports -> sales analysis. Criteria for report: Delivery Notes and you can see customers, Items and Sales Employees reports.
    The Items report, Sales Employees report and customers report have the same values.
    3.Closed the document "Delivery".
    4.And if we see the Items report, then the report will show us a zero quantity.
    How can I remove this error?
    Tnaks.

    Yes, i agree with Gordon.
    YOu can try this SQL query.
    SELECT T0.ITEMCODE,
    (SELECT SUM(T1.QUANTITY) FROM DLN1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 1 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'JAN QTY',
    (SELECT SUM(T1.QUANTITY) FROM DLN1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'FEB QTY',
    (SELECT SUM(T1.QUANTITY) FROM DLN1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 3 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'MAR QTY',
    (SELECT SUM(T1.QUANTITY) FROM DLN1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 4 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'APR QTY',
    (SELECT SUM(T1.QUANTITY) FROM DLN1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 5 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'MAY QTY',
    (SELECT SUM(T1.QUANTITY) FROM DLN1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 1 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'JUN QTY',
    (SELECT SUM(T1.QUANTITY) FROM DLN1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 7 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'JUL QTY',
    (SELECT SUM(T1.QUANTITY) FROM DLN1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 8 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'AUG QTY',
    (SELECT SUM(T1.QUANTITY) FROM DLN1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 9 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'SEP QTY',
    (SELECT SUM(T1.QUANTITY) FROM DLN1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 10 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'OCT QTY',
    (SELECT SUM(T1.QUANTITY) FROM DLN1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 11 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'NOV QTY',
    (SELECT SUM(T1.QUANTITY) FROM DLN1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 12 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'DEC QTY'
    FROM dbo.OITM T0
    LEFT JOIN dbo.DLN1 T1 ON T1.ItemCode = T0.ItemCode
    WHERE T0.SellItem = 'Y'
    GROUP BY T0.ItemCode,YEAR(T1.DOCDATE) HAVING YEAR(T1.DOCDATE) = YEAR(GETDATE())
    ORDER BY T0. ITEMCODE

  • Can we add new field to existing Sales Analysis by Item report?

    I would like to add sum total weight of all the items sold so far to the above system report?
    How could i do that please?
    Thanks.

    You need to have your own report. This system report is hard coded. You do not have option to add fields there.
    Thanks,
    Gordon

  • SAP Business One - Sales Analysis by Item - Adding Columns

    Is it possible to add columns to the Sales Analysis by Item report? As it is right now, I cannot add any columns even when I go to form settings.
    If so, how do I do this?
    Thank you!

    Dear Rahul,
    On another post I saw a solution for an inventory report I needed. However that one had an error on the AS' section. Before I repost, let me explain what I was trying to do. I need the item sales analysis report by month but I need to add the in stock (on hand) to the report. I found this one and a smaller version worked but one I used the complete version I received an error :
    1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near '<'.
    2). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword 'AS'.
    3). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect sy
    SELECT T0.ITEMCODE,
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 1 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'JAN QTY',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 1 AND T1.ITEMCODE
    = T0.ITEMCODE) AS 'JAN Amt',
    <FONT COLOR=RED>(SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'FEB QTY',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE
    = T0.ITEMCODE) AS 'FEB Amt',
    <FONT COLOR=RED>(SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'MAR QTY',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE
    = T0.ITEMCODE) AS 'MAR Amt',<FONT COLOR=RED>(SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'APR QTY',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE
    = T0.ITEMCODE) AS 'APR Amt',<FONT COLOR=RED>(SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'MAY QTY',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE
    = T0.ITEMCODE) AS 'MAY Amt',<FONT COLOR=RED>(SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'JUN QTY',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE
    = T0.ITEMCODE) AS 'JUN Amt',<FONT COLOR=RED>(SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'JUL QTY',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE
    = T0.ITEMCODE) AS 'JUL Amt',<FONT COLOR=RED>(SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'AUG QTY',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE
    = T0.ITEMCODE) AS 'AUG Amt',<FONT COLOR=RED>(SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'SEPT QTY',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE
    = T0.ITEMCODE) AS 'SEPT Amt',<FONT COLOR=RED>(SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'OCT QTY',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE
    = T0.ITEMCODE) AS 'OCT Amt',<FONT COLOR=RED>(SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'NOV QTY',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE
    = T0.ITEMCODE) AS 'NOV Amt',<FONT COLOR=RED>(SELECT SUM(T1.QUANTITY) FROM INV1 T1 with (NOLOCK)
    WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE =
    T0.ITEMCODE) AS 'DEC QTY',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE
    = T0.ITEMCODE) AS 'DEC Amt',
    </FONT>
    FROM [dbo].[OITM] T0
    LEFT JOIN [dbo].[INV1] T1 ON T1.ItemCode = T0.ItemCode
    WHERE T0.SellItem = 'Y'
    GROUP BY T0.ItemCode,YEAR(T1.DOCDATE) HAVING  YEAR(T1.DOCDATE) = YEAR(GETDATE())
    ORDER BY T0. ITEMCODE
    Could you help?
    Thank you,
    SA

  • Report to show the followup sales documents and items

    Sales had executed many sales quotations with customers over a period of time.
    Now the Sales Staff wanted to know how many sales documents and what/how many sales items are being purchased by the customer with respect to the quotation.
    Is there a report that list out the sales documents and items created w/respect to a particular quotation instead of looking at the document flow which is difficult to diagnose.
    Thanks

    hello, friend.
    you can try table VBFA, where you can see sales documents and their subsequent documents.
    for a general listing of quotations, use tcode VA25.
    regards.

  • Customer line item report with GL account display

    Hi
    Please guide some customer reports for the following
    Client need a Customer Line item reports with Customer number and repective gl account for each line items.
    for ex: Product A/c xxxxxx
              To Sales A/c xxxxxx(recon A/c)
    Thanks in advance

    Hi
    1.FBL5N -  Customer Line item Display (Customer Line item reports with Customer number )
    2.FBL1N - Vendor Line item Display
    3.FBL3N - General Ledger Line item Display
    The sales entry will be
         DR  Customer - to view this entry FBL5N
               CR Sales - to view this entry FBL3N
    Hope this will be usefull

  • Customer Open item Report S_ALR_87012174

    Hi
    As per my client requirement in Customer Open item Report S_ALR_87012174 bring the field "PO Number" into the layout."
    Kindly suggest me if any possibility is there?
    Thanks,
    Kumar

    Hi,
    The report S_ALR_87012174 uses the logical databse DDF which does not have this field of PO number (BSTKD) given in the sales order, as it is the customer purcchase order nu,ber for the sales application.
    This it is not availble for the data source, so the report can not be enhanced for that.
    You ned to create a custom report for the same, if needed this desperatly.
    Regards,
    Gaurav

  • Sales Analysis by Item: Show all items

    I am trying to look for a way to get a report that will show me the Sales Analysis by item, but show me all the items even if the item wasn't sold to any Business partner.
    Example:
    I have the following items and sales for today:
    Item A, invoice $100
    Item B, Invoice $200
    Item C, no sales
    Item D, Invoice $500
    If I run the sales analysis by item they will show me
    Item A, $100
    Item B, $200
    Item D, $500
    but I want to show it
    Item A, $100
    Item B, $200
    Item C, $0
    Item D, $500
    Please let me know if there is a way or a queries that I can do to get that result.
    Thank You,

    HI,
    Sales Analysis per item only display item with records.
    You can attain by creating a query to display your desired output.
    Please try to look in the forum for the sales report.
    example:
    [Sales report for the month.|Sales report for the month.]
    [Re: sales analysis report|Re: sales analysis report]
    [Re: A query report of sales invoices|Re: A query report of sales invoices]
    thanks.
    Clint
    Edited by: Clint T. Pauyon on Sep 24, 2011 12:09 PM

  • Sales Analysis by Items printed with PLD / SBO8.8 PL11

    Hi all,
    need to print the sales analysis by items on one page only with sales turnover per month (no columns with gross profit and %)
    Right now the systems is creating 3 pages for one report (1. page january until april, 2. page may until august, 3. page september until december).
    How can I change the report to print all months on one page.
    Thanks for answers.
    Gebhard

    Hi Gebhard,
    I am afraid you need your own report for your goal.  Try Crystal Report or XL Reporter.
    Thanks,
    Gordon

  • KE24 line item report  ( profitability line item report)

    Hi all,
    we need sub total sale order wise automatically in KE24 line item report  ( profitability line item report)  . How can i do for this .
    could you please help me.
    Regards,
    K.Satish
    [email protected]

    Hi,
    Please forward the same to my mail id:[email protected]
    Thanks in advance.
    Regards,
    Prasad

  • Profit center line item report

    Hello All,
    A sales order is created with reference to a service order, now when I see Profit center line items, the function area available in Service order is differ from the function area displaying with sales document number in profit center line item report. Can anyone please tell me where could be the problem.
    Full points will be awarded for the answer.
    Thanks & Regards
    Srini

    Hi,
    what SAP release do you have ?
    Normally the derivation of the functional area is made with the following logic:
    1) manually entered
    2) FI-Substitution (calling point 5 or 6 since ERP2004)
    3) cost center
    4) cost element
    Please see also SAP note 106180 of how to correct wrong functional areas in PCA.
    Best regards,
    Andreas

  • Sales order line items delivery cancelled but still appears in MD04.

    Hi PP Gurus,
    In the sales there are 6 line items are there out of which for 1 line item delivery and PGI happened. And for remaining line items delivery got cancelled, but these line items for which delivery cancelled appearing in the MD04, I have rejected the sales order line items but these line items still shows in MD04. Please advise how to remove these line items from MD04.
    Thanks and Regards,
    SHARAN.

    Hi
    Pl refer SAP Note : 1166713 for the Problem which says " You have posted goods issue and therefore the delivery requirements should no longer be existing. These inconsistencies can be seen using report SDRQCR21"
    Regards
    Brahmaji

  • Revenue Recognition based on User Status of assigned Sales Order line item

    Dear Community members,
    We have requirement to recognize / de-recognize revenue posted to WBS for calculation of RA, based on the 'User status' of the assigned Sales Order line item.
    To elaborate requirement further -
    1) WBS Element - XXX - 10 ( with operative indicator - Plan/Bill/Account Assign)
    2) Sales Order(SO) Line Items assigned to the above WBS -
    - SO No -  123 Line Item 10 - Actual Rev - $ 300 - User Status - EXE (Meaning this work is in progress , partial payment received thus actual revenue for RA at WBS is 'Zero'
    - SO No -  124 Line Item 20 - Actual Rev - $ 400 - User Status - COMPL(Meaning this work is Complete , all payment received thus actual revenue for RA at WBS is $400
    - SO No -  125 Line Item 10 - Actual Rev - $ 800 - User Status - EXE (Meaning this work is in progress , partial payment received thus actual revenue for RA at WBS is 'Zero'
    As per WBS reports Actual Revenue posted to WBS XXX-10 is $ 1500 ( $300$400$800) , however since two SO line items ( SO 123 /line item 10 and SO 125 / line Item 10 ) are NOT having User status 'COMPLETE', the actual revenue posted by those line items $ 1100/- ($300 + 800)  should not be included as Actual Revenue for RA at WBS level.
    Thus Actual Revenue for RA at WBS XXX-10 should be $ 400 /- ( the revenue posted by SO 124/line item 20 which has user status as 'COMPLETE')
    How do above can be achieved?? Is there any standard solution for this?? Is any SAP Note available for this (I too am looking for one but not found any ) ?? do we need any enhancement , Customer exit etc
    Thanks in advance
    with regards

    Hi,
    Thanks. You are right that the 'Completed Contract Method' would defer revenue recognition. However, the status checked would be of the RA object (WBS Element in this case, as RA key is on WBS and RA is being calculated on the WBS).
    However, our requirement is to check the user status of the Sales Order Line items assigned to the WBS element and filter the revenues posted based on the active user status of individual Sales Order Line item.
    Please give you inputs.
    Thanks in advance
    With regards

  • Sales Order Line item status with Resource Related Billing

    Hi
    The Resource related billing is done based on the costs accumulated on account assigned WBS Element. The WBS Element system status is set 'Finally Billed'. The overall status of Sales Order line item is still 'open' and does show up in 'Open Order' reports.
    SAP vide their note 439288 recommends running report SDVBUK00 to correct the sales Order item status. However this note is applicable only upto 4.6C. Our system in ECC 6.0. We tried running this report and did not get desired results. We checked the program and discovered that the corrections suggested as per above note, are not available.
    Is there any new SAP note applicable for ECC 6.0 needs to be applied ? Or is there any other report needs to be run in case of ECC6.0?
    Thanks in advance
    with regards

    HI,
    Please raise message to SAP through service marketplace.
    Thanks,
    Vrajesh

  • Display COPA line item report-KE24

    Hi Experts,
    Do we get the correct COPA line items by using the standard transaction code KE24. Is this report is useful to compare the values of the report KE30 which we define.
    Please clarify.
    Regards,
    Ram

    Hi All
    I had created sales order( MTO).
    Sales Order No 61224069 u2013 50
    Sales Order line item 40 created > PR & PO created (MD02) > MIGO > Delivery of Order (VL01N) > Settlement (VA88) >Billing( VF01) > Settlement (VA88).
    I have two COPA Document and Material Price updating 2 Time in COPA report.
    Please let me know Its Process error Or Configuration error.
    If Process --  Please let me know the correct process
    If Config    --  Please let me know where to check
    Thanks In Advance.

Maybe you are looking for