Sales analysis(amt wise)

hi,
    can i do a sales analysis( selection criteria as amountwise).
regards,
Vignesh

Hi Vignesh.......
Try this Query report.....
SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[DocRate], T0.[DocTotal],
T0.[GrosProfit] FROM OINV T0 WHERE T0.[DocTotal] >='[%0]' and  T0.[DocTotal] <='[%1]'
Hope this will help you.......

Similar Messages

  • Sales Analysis Report service warehouse wise

    Dear Experts,
    I've configured 4 service warehouses to an item  in SAP B1 8.8 PL:16.  And now I want to see sales analysis report of that particular item against each service warehouse. But from the Sales Analysis or purchase analysis report I can't able to see service warehouse wise sales quantity & amount.
    N.B.-Those items are created as Sales & Expense item only, no inventory.
    Plz help.
    Subrata

    Hi Subrata,
    in this case you need a customized report trough Query or through Crystal Report.
    regards,
    Fidel

  • Sales Analysis Report based on Supplier-wise

    Hi Experts,
    My client requirement is ,We are into trading so , we want a Sales analysis report based on Supplier-wise. like,
    Selection critieria is
    1)Supllier name
    2)From and To date.
    Heading are
    Item name     Sales UoM    Jan(quantity)   Feb(quanitity)   mar(quantity)   April(quanitiy).........
    here, i need only the sum of the quantity for the items for that particular month based on the date giving in selection criteria.
    Regards,
    Dwarak
    Edited by: Dwarak@SMS on Aug 23, 2010 4:29 PM

    Hi experts,
    For my clients requirement,
    I could able to alter my previous query(find below).
    My object is
    1)To get sales report based on Manufacturer.
    2)To get the TOTAL SALES QUANTITY OF THE MONTHS in the report. I go that in the below query, and only thing is that is have to minus the total Credit note for items to get the ACTUAL TOTAL SALES OF THE MONTHS. so , can anyone help me to alter the query to get me the ACTUAL TOTAL SALES OF THE MONTHS.
    the query is
    SELECT T0.ITEMCODE,T0.ItemName,T0.OnHand,
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 1 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())-0) AS 'JAN ',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())-0)  AS 'FEB ',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 3 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())-0)  AS 'MAR ',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 4 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())-0)  AS 'APR ',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 5 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())-0)  AS 'MAY ',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 6 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())-0)  AS 'JUN ',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 7 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())-0)  AS 'JUL ',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 8 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())-0)  AS 'AUG ',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 9 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())-0)  AS 'SEP ',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 10 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())-0)  AS 'OCT ',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 11 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())-0)  AS 'NOV ',
    (SELECT SUM(T1.QUANTITY) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 12 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())-0)  AS 'DEC '
    FROM dbo.OITM T0
    LEFT JOIN dbo.INV1 T1 ON T1.ItemCode = T0.ItemCode WHERE T0.SellItem = 'Y' and T0.[FirmCode] =[%0]
    GROUP BY T0.ItemCode,T0.Itemname,T0.OnHand,YEAR(T1.DOCDATE) HAVING YEAR(T1.DOCDATE) =
    YEAR(GETDATE())-0
    ORDER BY T0. ITEMCODE

  • Branch wise sales analysis report

    Hi
    Client wants to see sales analysis report branch wise. How to do so?
    Thanks

    Hi Molhatra,
    Try this,
    SELECT  T0.DocNum as 'SO. No.',
    T0.DocDate as 'SO. Date',
    T2.DocNum AS 'Del.Doc.No.',
    T2.DocDate AS 'Delivery Date',
    M.DocNum as 'A/R Invoice No.',
    M.DocDate as 'Inv. Date',
    M.CardName as 'Vendor Name',
    M.NumAtCard as 'Bill No. & Date',
    ISNULL(L.ItemCode,'Service Item') as 'Item Code',
    L.Dscription,
    L.Quantity,
    L.WhsCode,
    L.TaxCode,
    (Select Sum(LineTotal) From INV3 Q Where Q.DocEntry=M.DocEntry) AS 'Freight (Rs.)',
    M.WTSum AS 'TDS (Rs.)',
    M.DocTotal as 'Total (Rs.)'
    FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN ODLN T2 ON T2.DocEntry = T1.TrgetEntry
    INNER JOIN DLN1 T3 on T3.DocEntry = T2.Docentry
    INNER JOIN OINV M ON M.DocEntry = T3.TrgetEntry
    LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry
    LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
    LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry
    LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry
    WHERE M.DocDate >= '[%0]' AND M.DocDate <= '[%1]'
    AND
    L.WhsCode='[%2]'
    GROUP BY
    T0.DocNum,T0.DocDate,T2.DocNum,T2.DocDate, M.DocNum,M.DocDate,M.CardName,M.NumAtCard,L.ItemCode,L.Dscription,L.Quantity,
    L.WhsCode,L.TaxCode,M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
    ORDER BY
    T0.DocNum,T0.DocDate,T2.DocNum,T2.DocDate, M.DocNum,M.DocDate,M.CardName,M.NumAtCard,L.ItemCode,L.Dscription,L.Quantity,
    L.WhsCode,L.TaxCode,M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
    Regards,
    Madhan.

  • Sales Analysis Comparative

    Dear Experts,
    Hope you are having a great day. I just wanted to confide my problem in regards to my formula for generating the correct GP based on the sales analysis report from sap, for comparative purposes.
    Sales Analysis Report Screenshot from SAP
    The result query generates this:
    As you can see, GP%1 is positive, but on the SAP Analysis it is negative. Is there anyone who could help me generate the correct formula for that?
    Here's the query formula:
    Select
    a1.AM,
    a1.[AR Inv1],
    b1.[AR Inv2] ,
    a1.Year1_Qty,
    b1.Year2_Qty,
    a1.Year1_Amt as 'Total AR Invoice',
    b1.Year2_Amt as 'Total AR Invoice2',
    a1.Year1_GP as 'Gross Profit',
    b1.Year2_GP as 'Gross Profit 2',
    (a1.Year1_GP/NULLif(a1.Year1_Amt,0))*100 as 'GP%1',
    (b1.Year2_GP/NULLif(b1.Year2_Amt,0))*100 as 'GP%2'
    from
    Many thanks for the help..
    Best Regards,
    JZA

    Hello Sir,
    Here's the complete query.
    declare @Date1 datetime
    declare @Date2 datetime
    declare @Date3 datetime
    declare @Date4 datetime
    SET @Date1 = /* t7.DocDate */ '[%0]'
    SET @Date2 = /* t7.DocDate */  '[%1]'
    SET @Date3 = /* d7.DocDate */ '[%2]'
    SET @Date4 = /* d7.DocDate */  '[%3]'
    Select
    a1.AM,
    a1.[AR Inv1],
    b1.[AR Inv2] ,
    a1.Year1_Qty,
    b1.Year2_Qty,
    a1.Year1_Amt as 'Total AR Invoice',
    b1.Year2_Amt as 'Total AR Invoice2',
    a1.Year1_GP as 'Gross Profit',
    b1.Year2_GP as 'Gross Profit 2',
    NUllif(a1.Year1_GP/(a1.Year1_Amt),0)*100 as 'GP%1',
    NUllif(b1.Year2_GP/(b1.Year2_Amt),0)*100 as 'GP%2'
    from
    select
    a.SlpName 'AM', COUNT(distinct a.DocNum) 'AR Inv1',
    SUM( a.Qty)'Year1_Qty', sum(a.Amt) 'Year1_Amt', sum(a.GP) 'Year1_GP' -- , SUM(a.[GP %]) as 'GPercent'
    from
           select t4.SlpName 'SlpName',  t7.docdate ,
           t7.docnum,t3.itemcode,
           CASE when t7.CANCELED = 'Y' then t3.Quantity*-1
           Else t3.Quantity
           end 'Qty',
           CASE when t7.CANCELED = 'Y' then (T3.[LineTotal]- (T3.[LineTotal]* ( ISNULL(T7.DiscPrcnt,0)/100)) )*-1
           else T3.[LineTotal]- (T3.[LineTotal]* ( ISNULL(T7.DiscPrcnt,0)/100)) end 'Amt',
           CASE when t7.CANCELED = 'Y' then T3.[GrssProfit]*-1   
           else T3.[GrssProfit] end 'GP',
           CASE when t7.CANCELED = 'Y' then  ((T3.[GrssProfit] / ((nullif(T3.[LineTotal],0)) - ((T3.[LineTotal])* (ISNULL(T7.DiscPrcnt,0)/100))))*100)*-1
           else (T3.[GrssProfit] / ((nullif(T3.[LineTotal],0)) - ((T3.[LineTotal])* (ISNULL(T7.DiscPrcnt,0)/100))))*100 end as 'GP %'
           from INV1 t3
           left outer join oinv t7 on t3.docentry = t7.docentry
           left outer join oslp t4 on t7.SlpCode = t4.SlpCode
           left outer join OITM t8 on t3.itemcode = t8.itemcode
           where
          t7.docdate >= '[%0]' and t7.docdate <= '[%1]'
           UNION
           select t4.SlpName 'SlpName', T9.docdate ,
           t9.DocNum, t5.itemcode,t5.Quantity*-1 'Qty',
           CASE when t9.CANCELED = 'Y' and t9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
                when t9.CANCELED = 'C' and t9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))
                when T9.CANCELED = 'N' and T9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
                when T9.CANCELED = 'N' and T9.DocStatus = 'O' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
           else(T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100))) end'Amt',
           T5.[GrssProfit]*-1  'GP',
           CASE when t9.CANCELED = 'Y' then  ((T5.[GrssProfit] / ((nullif(T5.[LineTotal],0)) - ((T5.[LineTotal])* (ISNULL(T9.DiscPrcnt,0)/100))))*100)*-1
           else (T5.[GrssProfit] / ((nullif(T5.[LineTotal],0)) - ((T5.[LineTotal])* (ISNULL(T9.DiscPrcnt,0)/100))))*100 end as 'GP %' 
           from ORIN t9
           Left outer join RIN1 t5 on t9.docEntry = t5.DocEntry
           left outer join oslp t4 on t9.SlpCode = t4.SlpCode
           left outer join OITM t8 on t5.itemcode = t8.itemcode
           where
            t9.docdate >= '[%0]' and t9.docdate <= '[%1]'
        ) A
        group by a.SlpName
    )A1
    full  join
    select
    a.SlpName 'AM', COUNT(distinct a.DocNum) 'AR Inv2',
    SUM( a.Qty)'Year2_Qty', sum(a.Amt) 'Year2_Amt', sum(a.GP) 'Year2_GP' --, SUM(a.[GP %]) as 'GPercent'
    from
           select t4.SlpName 'SlpName',  t7.docdate ,
           t7.docnum,t3.itemcode,
           CASE when t7.CANCELED = 'Y' then t3.Quantity*-1
           Else t3.Quantity
           end 'Qty',
           CASE when t7.CANCELED = 'Y' then (T3.[LineTotal]- (T3.[LineTotal]* ( ISNULL(T7.DiscPrcnt,0)/100)) )*-1
           else T3.[LineTotal]- (T3.[LineTotal]* ( ISNULL(T7.DiscPrcnt,0)/100)) end 'Amt',
           CASE when t7.CANCELED = 'Y' then T3.[GrssProfit]*-1   
           else T3.[GrssProfit] end 'GP',
           CASE when t7.CANCELED = 'Y' then  ((T3.[GrssProfit] / ((nullif(T3.[LineTotal],0)) - ((T3.[LineTotal])* (ISNULL(T7.DiscPrcnt,0)/100))))*100)*-1
           else (T3.[GrssProfit] / ((nullif(T3.[LineTotal],0)) - ((T3.[LineTotal])* (ISNULL(T7.DiscPrcnt,0)/100))))*100 end as 'GP %'
           from INV1 t3
           left outer join oinv t7 on t3.docentry = t7.docentry
           left outer join oslp t4 on t7.SlpCode = t4.SlpCode
           left outer join OITM t8 on t3.itemcode = t8.itemcode
           where
           t7.docdate >= '[%=2]' and t7.docdate <= '[%3]'
           UNION
           select t4.SlpName 'SlpName', T9.docdate ,
           t9.DocNum, t5.itemcode,t5.Quantity*-1 'Qty',
           CASE when t9.CANCELED = 'Y' and t9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
                when t9.CANCELED = 'C' and t9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))
                when T9.CANCELED = 'N' and T9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
                when T9.CANCELED = 'N' and T9.DocStatus = 'O' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
           else(T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100))) end'Amt',
           T5.[GrssProfit]*-1  'GP',
           CASE when t9.CANCELED = 'Y' then  ((T5.[GrssProfit] / ((nullif(T5.[LineTotal],0)) - ((T5.[LineTotal])* (ISNULL(T9.DiscPrcnt,0)/100))))*100)*-1
           else (T5.[GrssProfit] / ((nullif(T5.[LineTotal],0)) - ((T5.[LineTotal])* (ISNULL(T9.DiscPrcnt,0)/100))))*100 end as 'GP %' 
           from ORIN t9
           Left outer join RIN1 t5 on t9.docEntry = t5.DocEntry
           left outer join oslp t4 on t9.SlpCode = t4.SlpCode
           left outer join OITM t8 on t5.itemcode = t8.itemcode
           where
           t9.docdate >= '[%2]' and t9.docdate <= '[%3]'
        ) A
            group by a.SlpName
    ) B1
    on a1.am = b1.am
    I am almost done analyzing one whole month sales analysis. Now the problem I got upon testing is
    this 1st query combined from OINV and ORIN. Wherein the result I got has a discrepancy from ORIN with docnum = 100120
    Query
    select t4.SlpName 'SlpName',  t7.docdate ,
    t7.docnum,t3.itemcode,
    CASE when t7.CANCELED = 'Y' then t3.Quantity*-1
    Else t3.Quantity
    end 'Qty',
    CASE when t7.CANCELED = 'Y' then (T3.[LineTotal]- (T3.[LineTotal]* ( ISNULL(T7.DiscPrcnt,0)/100)) )*-1
    else T3.[LineTotal]- (T3.[LineTotal]* ( ISNULL(T7.DiscPrcnt,0)/100)) end 'Amt',
    CASE when t7.CANCELED = 'Y' then T3.[GrssProfit]*-1
    else T3.[GrssProfit] end 'GP',
    CASE when t7.CANCELED = 'Y' then  ((T3.[GrssProfit] / ((nullif(T3.[LineTotal],0)) - ((T3.[LineTotal])* (ISNULL(T7.DiscPrcnt,0)/100))))*100)*-1
    else (T3.[GrssProfit] / ((nullif(T3.[LineTotal],0)) - ((T3.[LineTotal])* (ISNULL(T7.DiscPrcnt,0)/100))))*100 end as 'GP %'
    from INV1 t3
    left outer join oinv t7 on t3.docentry = t7.docentry
    left outer join oslp t4 on t7.SlpCode = t4.SlpCode
    left outer join OITM t8 on t3.itemcode = t8.itemcode
    where
    t7.docdate >= '2014.07.31' and t7.docdate <= '2014.07.31'
    and T4.SlpName = 'PPM'
    UNION
    select t4.SlpName 'SlpName', T9.docdate ,
    t9.DocNum, t5.itemcode,t5.Quantity*-1 'Qty',
    CASE when t9.CANCELED = 'Y' and t9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
    when t9.CANCELED = 'C' and t9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))
    when T9.CANCELED = 'N' and T9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
    when T9.CANCELED = 'N' and T9.DocStatus = 'O' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
    else(T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100))) end'Amt',
    T5.[GrssProfit]*-1  'GP',
    CASE when t9.CANCELED = 'Y' then  ((T5.[GrssProfit] / ((nullif(T5.[LineTotal],0)) - ((T5.[LineTotal])* (ISNULL(T9.DiscPrcnt,0)/100))))*100)*-1
    else (T5.[GrssProfit] / ((nullif(T5.[LineTotal],0)) - ((T5.[LineTotal])* (ISNULL(T9.DiscPrcnt,0)/100))))*100 end as 'GP %' 
    from ORIN t9
    Left outer join RIN1 t5 on t9.docEntry = t5.DocEntry
    left outer join oslp t4 on t9.SlpCode = t4.SlpCode
    left outer join OITM t8 on t5.itemcode = t8.itemcode
    where
    t9.docdate >= '2014.07.31' and t9.docdate <= '2014.07.31'
    and T4.SlpName = 'PPM'
    RESULT:
    But if I am just going to run query for ORIN only this is the result.
    As you can see there are two items in ORIN for docnum 100120, while if i unite it with OINV the result for 100120 only returns 1 data. Kindly help.
    And thank you so much sir for viewing my query.
    Best Regards,
    JZA
    Message was edited by: JZA

  • Hide Particular Item Group from Selection Criteria of Sales Analysis Report

    Hello Experts,
    Is this possible to Hide Particular Item Group from Selection Criteria of Sales Analysis Report?
    I have one Item Group as 'Special Items'.
    Now, when I open  Item wise sales analysis report, I want to hide above mentioned group from selection criteria.
    Thanks in advance.
    Best Regards,
    Pankit Sheth

    Hi,
    1. Not possible to put validation for selection criteria windows.
    2. In standard, I don't think it is possible to hide only one item group.
    3. Alternatively don't give authorization to user for running sales reports. If still need create customized query and ask user run every month.
    Thanks & Regards,
    Nagarajan

  • Pivot sales analysis report by day for a particular month - sap has by month and annual

    Hi guys,
    I'm trying to come up with a pivot sales analysis query report for items for the month by displaying individual days sales, sales amount, gross profit, gross profit %
    e.g
    Month of March
    1st, 2nd, 3rd, 4th.....31st march. In sap their is a sales analysis report by
    days of the month
    1st March
    2nd march
    31st march
    item no
    item description
    Qty
    sale amount
    gross profit
    gross profit%
    qty
    sale amt
    gross profit
    gross profit %
    Qty
    sale amt
    gross profit
    gross profit %
    sugar
    20
    20,000
    5,000
    25
    30
    30,000
    10000
    33.3
    40
    40000
    15000
    37.5
    n02
    n03
    no4
    Regards Brian

    Hi,
    Due to pivot limitation, not possible to get above data in pivot table.
    Try this simple query which matches system sales analysis by item.
    SELECT t1.itemcode as Itemcode, T1.[Dscription] as 'Item description',  sum(T1.[Quantity]) as Qty, sum(T1.[LineTotal]) as 'sales amount', sum(T1.[GrssProfit]) as 'Gross Profit'
    FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry WHERE month( T0.[DocDate]) = '1' and year( T0.[DocDate]) =2014 GROUP BY T1.[ItemCode], T1.[Dscription]
    Thanks & Regards,
    Nagarajan

  • Query to mimic the items tab of the Sales Analysis report.

    Hi there,
    I'm currently looking to create a query that mimics the behaviour of the Sales Analysis report in B1. The items tab of the Sales Analysis report provides all the data I require - the only issue is that I would like to merge this data with some other data regarding current on hand stock quantities etc. and therefore I would like to be able to pull out the query behind the Sales Analysis report.
    I'm assuming this cannot be done and therefore I'm attempting to build a query to replicate the results. The query needs to show Item No, Item Description, Quantity Sold, Sales Amt (in system currency), Gross Profit and Gross Profit % for items within a given period.
    If this can be done relatively easily, can the query then be modified to show all items (including items that haven't sold in the date range) merely with '0' for Quantity Sold, Sales Amt etc. if the item hasn't been sold in the period, and the appropriate figures if each of these columns if the item has sold. I assume some kind of CASE statement can be used to generate this.
    So the query needs to show Item No, Item Description, Current quantity in stock, Quantity Sold, Sales Amt (in system currency), Gross Profit and Gross Profit % for all items within a given date range.
    I hope you can assist me with this problem.
    Thanks
    Grant.

    Hi,
    Thanks Gordon that was exactly what I needed.
    I've been trying to add some additional columns to the query but I'm experiencing some errors and I can't quite tell why.
    Basically, here's the code from another working query I have which I wish to merge into the query you've suggested above:
    SELECT T0.[ItemCode],
    T0.[ItemName],
    T3.[ItmsGrpNam],
    T4.[Name] AS [Sub-Category],
    T5.[Name] AS [Sub-Sub-Category],
    T0.[CardCode] AS [Pref Supplier],
    T6.[FirmName] AS [Brand],
    T0.[U_Range],
    T0.[OnHand],
    CASE WHEN T0.[StockValue] = 0 THEN 0 ELSE T0.[StockValue] END AS [StockValue],
    T1.[Price] AS [PBK GBP Price],
    CASE WHEN T0.[OnHand] = 0 THEN T0.[LastPurPrc] ELSE T0.[StockValue]/T0.[OnHand] END AS [Ave Cost],
    CASE WHEN T0.[OnHand] = 0 THEN T1.[Price]-T0.[LastPurPrc] ELSE CASE WHEN T0.[OnHand] > 0 THEN T1.[Price]-T0.[StockValue]/T0.[OnHand] END END AS [Margin],
    CASE WHEN T0.[OnHand] = 0 AND T0.[LastPurPrc] = 0 THEN 0 ELSE CASE WHEN T0.[OnHand] > 0 AND (T0.[StockValue]/T0.[OnHand]) = 0 THEN 0 ELSE CASE WHEN T0.[OnHand] = 0 THEN (T1.[Price]-T0.[LastPurPrc])/T1.[Price]*100 ELSE CASE WHEN T0.[OnHand] > 0 THEN (T1.[Price]-T0.[StockValue]/T0.[OnHand])/T1.[Price]*100 END END END END AS [Margin %],
    T0.[LastPurPrc]
    FROM [dbo].[OITM]  T0 INNER JOIN [dbo].[ITM1]  T1 ON T0.ItemCode = T1.ItemCode INNER JOIN [dbo].[OITB]  T3 ON T0.ItmsGrpCod = T3.ItmsGrpCod LEFT OUTER JOIN [dbo].[@U_SUBCATEGORY]  T4 ON T0.U_Subcategory = T4.Code LEFT OUTER JOIN [dbo].[@U_SUBSUBCATEGORY]  T5 ON T0.U_SubSubCategory = T5.Code INNER JOIN OMRC T6 ON T0.FirmCode = T6.FirmCode
    WHERE T0.[OnHand] >= 0 and T0.U_Range not in ('E','X')  
    ORDER BY T0.[ItemCode]
    Essentially I just wish to add the fields which are specified in the query above, but not in the query you've already suggested:
    SELECT T0.ItemCode,
    Max(T0.ItemName),
    Max(IsNull(T0.OnHand,0)) 'In Stock',
    SUM(IsNull(T1.Quantity,0)) 'Quantity',
    Sum(IsNull(T1.LineTotal,0)) 'Sales Amt',
    SUM(IsNull(T1.GrssProfit,0)) 'Gross Profit',
    Case WHEN Sum(Isnull(T1.LineTotal,0)) = 0 THEN 0 ELSE
    SUM(IsNUll(T1.GrssProfit,0))/Sum(Isnull(T1.LineTotal,0)) * 100 END 'Gross Profit %'
    FROM dbo.OITM T0
    LEFT JOIN dbo.INV1 T1 ON T1.ItemCode=T0.ItemCode
    LEFT JOIN dbo.OINV T2 ON T2.DocEntry=T1.DocEntry AND T2.DocDate Between [%0] AND [%1]
    GROUP BY T0.ItemCode
    I was hoping it would be fairly straight forward but so far I've had limited success.
    What am I missing here?
    Thanks in advance!

  • Sales analysis report and P&L match in SAP b1

    Dear All,
    I am running Sales Analysis report customerwise and item wise where the total of Sales Amount is matching with Revenue amount in profit and loss report for the month April 2011 only.
    But after that these reports are not matchinhg. Please guide in this regard.
    There are some items having valuation method standard, FIFo and moving average.
    Regards
    Aarati Kollur

    Dear Jitin,
    Thanks for quick reply,
    i run the report for item for the April 2011 where total matchs with revenue even there are some service type of A/R Invoices.
    Does sales analysis report consider service type of document in both customer wise and item wise.
    Regards
    Aarati. Kollur

  • Sale Analysis Profit Calculation problem

    Hello
    I create sale Invoice having Qty 2 unit price 150 & tax code is VAT@4% then Base amount is 300 & Total Bill
    amt is 312.
    My purchase price for the same item is INR 100 so my Gross profit show on Bill is INR 100 & profit percent
    is 33.33%
    Customer will debit with INR 312
    But when Create Rate difference bill ie credit memo of INR 20 per uint ie Qty 2 Tax VAT@4%  (maintain
    drop ship warehouse in row level to can't reduce the qty)
    Customer will debit -41.60
    So Customer Debit balance is 270.40
    But when I run Sale analysis report the result shows that Gross profit INR 260 & Gross Profit % is 100%
    But actually i calculated manually the real Profit is INR 60 & Profit % should be 23.08 should be show in sale
    analysis
    So what i do to see the same result

    Hi
    There is some problem in sales analysis report in some of the sap versions. Refer the following documents.
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3030303130313637303426]
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3135383735363826]
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3136363835363426]
    Regards,
    Sudhir B.

  • Sales Analysis Report for Batch Numbers

    I am currently having an issue with Batch numbers and sales analysis report item wise. If the goods are delivered it does not show the quantity in the report. is there a way to make the quantites show. Open delivery notes show the quantity in the report. Could the reason be that once the delivery note is closed the quantity does not show in the report.????

    Dear Mr Shah,
    If I understood correctly, you are saying that there is no issue in adding the document with the batch but it is not shown in the Sales Analysis report?
    The Sales Analysis report does not show information regarding the quantity because it focuses on the value of the document.
    In order to have an overview on the trasactions related to the batches please use the Batch Number Transaction Report under Inventory - Inventory report.
    Regards,
    Marcella Rivi
    SAP Business One Forums Team

  • Wrong Qty Showing in Sales Analysis Report

    Dear All
    When we run Sales Analysis Report Item Wise by selecting Delivery Note in the selection, then it shows '0' or '-1' in Quantity field. It should show totat quantity delivered of each item.
    Can anyone elaborate this why it happens?
    Thanks and Best Regards
    Nabeel

    Dear Rahul
    I haven't unblocked negative inventory check. But that will not create any affect in Sales Analysis Report.
    Regards
    Nabeel

  • 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

  • Customer Ageing analysis-Region wise

    Hi,
    There is a requirement to see Customer ageing analysis region wise. Regions in SD are defined as Sales Offices. Sales offices are at the header level in Sales Order.
    If we can bring Sales office in Accounting document in some field, is there any way to see region wise ageing analysis in standard report.
    They also want to see Sales employee wise ageing analysis.Please let me know If there is any way out for this in standard.
    Regards,

    Hi,
    In the Standard Report Itself, if you select dynamic selection, you get the option of selecting the region from the Customer Master.  TCode (S_ALR_87012178)
    With this, you can achieve the result of getting the ageing report region wise.
    Hope this information is of some help to you.
    Appreciate any points awarded if found useful.
    Regards,
    Venkat

  • Sales Analysis PER DAY SALE

    Hello Experts,
    In Sales Analysis Report, I want to see the Per Day Sales and the Quantity. I checked it through Item wise, but actually in this Tab (Item), in Quantity Column system only shows open Quantity.
    If a DO has been invoiced that Quantity will become Zero.
    How do I see the Total sales quantity WISE ?
    Thanks & Regards

    There are two XL Reporter Reports called "Sales Register" and "Daily Stock Account".
    These are under Indian Legal Reports and made specially for Indian Localization Format.
    I think these reports can solve your requirement.

Maybe you are looking for

  • Fox formula - Copy variable value to a characteristic in IP

    Hi All, I have to copy the value of a variable to a characteristic in Fox formula in IP. In this scenario I am forecasting data using copy function. Whenever new data is copied I need to save it as a new version. So in the fox formula I have mentione

  • HD icon not showing up in "test" user account

    Hi All, I recently had problems with my MBP hard drive, which ultimately failed. I have since replaced it with a new 750 GB (7200 RPM) drive. I decided to create a "test" user account with admin privileges for troubleshooting purposes. However when I

  • Installing the purchased piano lessons fails. message said .no internet connection,however I am connected.

                Hallo There. Just recently I downloaded the upgrade for garage band.I purchased the Extra piano lessons. The installation of this is going for hours As the modem shows.Than the messages appears stating < Garage band can no longer continue

  • How to update logic express 9.01 under lion?

    After I installed Lion on my computer I recognized that i missed to update Logic express from 9.01 to 9.1, so the old version is not able to run under Lion. If I try now to update Logic express the system tells me to update from 9.01 what is recommen

  • How to debug a BSP

    Hi not a developer, but I am looking for either error logs or a method to debug BSP when something doesnt work on the page. Any suggestions? Thanks Jeremy Baker