Sales Analysis query per item group summarized per BP Group

Dear experts,
My client is requiring me to create a query that when i select a certain item group it returns a sum/total of sold items in that group per BP group
format:
parameter: Item Group A
BP Group A    1,000
BP Group B    2,000
BP Group C   1,000
I have managed to get total sales per BP Group but i cant seem to figure how to break it down per Item Group
here is my query:
SELECT T2.[GroupCode], SUM(ISNULL(T0.Debit,0) - ISNULL(T0.Credit,0)) as "Amount(LC)" FROM JDT1 T0  INNER JOIN OJDT T1 ON T0.TransId = T1.TransId and T0.TransType IN (13,14)
INNER JOIN OCRD T2 ON T2.CardCode = T0.ShortName
WHERE T1.[RefDate]  BETWEEN [%0] and [%1]
GROUP BY T2.[GroupCode]
how can I link Item Groups to JDT1?

Hi Carlo
Try This
SELECT t5.ItmsGrpNam AS ItemGroup,
   t7.GroupName AS BPGroup,
   SUM(ISNULL(T0.Debit,0) - ISNULL(T0.Credit,0)) AS "Amount(LC)"
FROM JDT1 T0
INNER  JOIN OINV T1 ON T0.transid = T1.transid
LEFT OUTER JOIN INV1 T3 ON T1.docentry = T3.docentry
LEFT OUTER JOIN oitm T4 ON t4.itemcode = T3.itemcode
LEFT OUTER JOIN oitb T5 ON T4.ItmsGrpCod = T5.ItmsGrpCod
INNER  JOIN ocrd T6 ON T0.ShortName = T6.CardCode
INNER JOIN OCRG T7 ON t7.GroupCode=t6.GroupCode
WHERE T1.DocDate BETWEEN [%0] AND [%1]
GROUP BY t5.ItmsGrpNam,
   t7.GroupName
Rgds

Similar Messages

  • Sales Analysis query issue

    Experts,
    I have compiled a Sales Analysis Query for a client who need more information than the Sales Analysis in SBO can give them.
    I have found that if I only run the Months of July and August (choose these randomly) I get the correct amounts in the July and August columns.
    When I add these months to the whole query, July and August gets multiplied. The more invoices I add for a specific customer the more it is multiplied.
    I need to know what is wrong with the whole query. Any help would be appreciated.
    Here is the July & August query that is correct:
    SELECT T0.[CardCode], T0.[CardName],
    (SUM(T9.Debit) - sum(T9.Credit)) AS 'July',
    (SUM(T10.Debit) - sum(T10.Credit)) AS 'August'
    FROM  OCRD T0
    LEFT JOIN JDT1 T9 ON T9.ShortName = T0.CardCode AND Month(T9.Duedate) = 7  AND Year(T9.Duedate) = 2010 AND T9.TransType in ('13','14')
    LEFT JOIN JDT1 T10 ON T10.ShortName = T0.CardCode AND Month(T10.Duedate) = 8 AND Year(T10.Duedate) = 2010 AND T10.TransType in ('13','14')
    WHERE T0.CardType = 'C'
    Group By T0.[CardCode], T0.[CardName]
    Here is the Total query that mulitplies the data per month:
    SELECT T0.CardCode, T0.CardName,
    (SUM(T1.Debit) - sum(T1.Credit)) AS 'Total Sales 2009', ((SUM(T1.Debit) - sum(T1.Credit))/12) AS '2009 Monthly Avg', (SUM(T2.Debit) - sum(T2.Credit)) AS 'Total Sales 2010',
    ((SUM(T2.Debit) - sum(T2.Credit))/Month(GetDate())) AS '2010 Monthly Avg',
    (SUM(T3.Debit) - sum(T3.Credit)) AS 'January 2010',
    (SUM(T4.Debit) - sum(T4.Credit)) AS 'February 2010',
    (SUM(T5.Debit) - sum(T5.Credit)) AS 'March 2010',
    (SUM(T6.Debit) - sum(T6.Credit)) AS 'April 2010',
    (SUM(T7.Debit) - sum(T7.Credit)) AS 'May 2010',
    (SUM(T8.Debit) - sum(T8.Credit)) AS 'June 2010',
    (SUM(T9.Debit) - sum(T9.Credit)) AS 'July 2010',
    (SUM(T10.Debit) - sum(T10.Credit)) AS 'August 2010',
    (SUM(T11.Debit) - sum(T11.Credit)) AS 'September 2010',
    (SUM(T12.Debit) - sum(T12.Credit)) AS 'October 2010',
    (SUM(T13.Debit) - sum(T13.Credit)) AS 'November 2010',
    (SUM(T14.Debit) - sum(T14.Credit)) AS 'December 2010'
    FROM  OCRD T0
    LEFT JOIN JDT1 T1 ON T1.ShortName = T0.CardCode AND Year(T1.Duedate) = 2009 AND T1.TransType in ('13','14')
    LEFT JOIN JDT1 T2 ON T2.ShortName = T0.CardCode AND Year(T2.Duedate) = 2010 AND T2.TransType in ('13','14')
    LEFT JOIN JDT1 T3 ON T3.ShortName = T0.CardCode AND Month(T3.Duedate) = 1  AND Year(T3.Duedate) = 2010 AND T3.TransType in ('13','14')
    LEFT JOIN JDT1 T4 ON T4.ShortName = T0.CardCode AND Month(T4.Duedate) = 2 AND Year(T4.Duedate) = 2010 AND T4.TransType in ('13','14')
    LEFT JOIN JDT1 T5 ON T5.ShortName = T0.CardCode AND Month(T5.Duedate) = 3 AND Year(T5.Duedate) = 2010 AND T5.TransType in ('13','14')
    LEFT JOIN JDT1 T6 ON T6.ShortName = T0.CardCode AND Month(T6.Duedate) = 4 AND Year(T6.Duedate) = 2010 AND T6.TransType in ('13','14')
    LEFT JOIN JDT1 T7 ON T7.ShortName = T0.CardCode AND Month(T7.Duedate) = 5 AND Year(T7.Duedate) = 2010 AND T7.TransType in ('13','14')
    LEFT JOIN JDT1 T8 ON T8.ShortName = T0.CardCode AND Month(T8.Duedate) = 6 AND Year(T8.Duedate) = 2010 AND T8.TransType in ('13','14')
    LEFT JOIN JDT1 T9 ON T9.ShortName = T0.CardCode AND Month(T9.Duedate) = 7 AND Year(T9.Duedate) = 2010 AND T9.TransType in ('13','14') 
    LEFT JOIN JDT1 T10 ON T10.ShortName = T0.CardCode AND Month(T10.Duedate) = 8 AND Year(T10.Duedate) = 2010 AND T10.TransType in ('13','14')
    LEFT JOIN JDT1 T11 ON T11.ShortName = T0.CardCode AND Month(T11.Duedate) = 9 AND Year(T11.Duedate) = 2010 AND T11.TransType in ('13','14') 
    LEFT JOIN JDT1 T12 ON T12.ShortName = T0.CardCode AND Month(T12.Duedate) = 10 AND Year(T12.Duedate) = 2010 AND T12.TransType in ('13','14')
    LEFT JOIN JDT1 T13 ON T13.ShortName = T0.CardCode AND Month(T13.Duedate) = 11 AND Year(T13.Duedate) = 2010 AND T13.TransType in ('13','14')
    LEFT JOIN JDT1 T14 ON T14.ShortName = T0.CardCode AND Month(T14.Duedate) = 12 AND Year(T14.Duedate) = 2010 AND T14.TransType in ('13','14')
    WHERE T0.CardType = 'C'
    Group By T0.CardCode, T0.CardName

    Hi,
    Try this
    SELECT T0.CardCode, T0.CardName,
    (SUM(T1.Debit) - sum(T1.Credit)) AS 'Total Sales 2009', ((SUM(T1.Debit) - sum(T1.Credit))/12) AS '2009 Monthly Avg', (SUM(T1.Debit) - sum(T1.Credit)) AS 'Total Sales 2010',
    ((SUM(T1.Debit) - sum(T1.Credit))/Month(GetDate())) AS '2010 Monthly Avg',
    ((sum(Case DATENAME(month,T1.DueDate) when 'January' then T1.Debit  else 0 end)-sum(Case DATENAME(month,T1.DueDate) when 'January' then T1.Credit  else 0 end))) Jan,
    (sum(Case DATENAME(month,T1.DueDate) when 'February' then T1.Debit  else 0 end)-sum(Case DATENAME(month,T1.DueDate) when 'February' then T1.Credit else 0 end))[Feb],
    (sum(Case DATENAME(month,T1.DueDate) when 'March' then T1.Debit  else 0 end)-sum(Case DATENAME(month,T1.DueDate) when 'March' then T1.Credit else 0 end))Mar,
    (sum(Case DATENAME(month,T1.DueDate) when 'April' then T1.Debit  else 0 end)-sum(Case DATENAME(month,T1.DueDate) when 'April' then T1.Credit else 0 end))Apr,
    (sum(Case DATENAME(month,T1.DueDate) when 'May' then T1.Debit  else 0 end)-sum(Case DATENAME(month,T1.DueDate) when 'May' then T1.Credit else 0 end))May,
    (sum(Case DATENAME(month,T1.DueDate) when 'June' then T1.Debit  else 0 end)-sum(Case DATENAME(month,T1.DueDate) when 'June' then T1.Credit else 0 end))Jun,
    (sum(Case DATENAME(month,T1.DueDate) when 'July' then T1.Debit  else 0 end)-sum(Case DATENAME(month,T1.DueDate) when 'July' then T1.Credit else 0 end))Jul,
    (sum(Case DATENAME(month,T1.DueDate) when 'August' then T1.Debit  else 0 end)-sum(Case DATENAME(month,T1.DueDate) when 'August' then T1.Credit else 0 end))Aug,
    (sum(Case DATENAME(month,T1.DueDate) when 'September' then T1.Debit  else 0 end)-sum(Case DATENAME(month,T1.DueDate) when 'September' then T1.Credit else 0 end))Sep,
    (sum(Case DATENAME(month,T1.DueDate) when 'October' then T1.Debit  else 0 end)-sum(Case DATENAME(month,T1.DueDate) when 'January' then T1.Credit else 0 end))Oct,
    (sum(Case DATENAME(month,T1.DueDate) when 'November' then T1.Debit  else 0 end)-sum(Case DATENAME(month,T1.DueDate) when 'November' then T1.Credit else 0 end))Nov,
    (sum(Case DATENAME(month,T1.DueDate) when 'December' then T1.Debit  else 0 end)-sum(Case DATENAME(month,T1.DueDate) when 'December' then T1.Credit else 0 end)) Dec
    FROM  OCRD T0
    LEFT JOIN JDT1 T1 ON T1.ShortName = T0.CardCode AND Year(T1.Duedate) = 2010   AND T1.TransType in ('13','14')
    WHERE T0.CardType = 'C'
    group by DATENAME(month,T1.DueDate), T0.CardCode, T0.CardName
    Thanks,
    Neetu

  • Sales Analysis Query

    Dear Experts,
    Want to Sales Analysis Query same as Sales Analysis in SAP
    In standard SAP when we run report with anual slection criteria for eg, 01/04/2010 To 31/03/12
    it's show in one column not display in compare with Quaterwise & Monthwise report.
    Result for query is
    Customer Code, Customer Name, Year2010 (Sales), Year2011 (Sales), Year2012 (Sales)
    Please help me.
    BR
    Deep

    Ok........
    It was my query mistake.......
    Please try this......
    SELECT Distinct T0.CardCode,T0.CardName, 
    (isnull((SELECT SUM((case when SUBSTRING((CONVERT(VARCHAR(11),T4.DOCDATE,106)),8,11) like '2006%' then T4.LineTotal else 0 end))
          FROM INV1 T4 WHERE T4.ItemCode=T1.ItemCode ),0)) '2006',
    (isnull((SELECT SUM((case when SUBSTRING((CONVERT(VARCHAR(11),T4.DOCDATE,106)),8,11) like '2007%' then T4.LineTotal else 0 end))
          FROM INV1 T4 WHERE T4.ItemCode=T1.ItemCode ),0)) '2007',
    (isnull((SELECT SUM((case when SUBSTRING((CONVERT(VARCHAR(11),T4.DOCDATE,106)),8,11) like '2008%' then T4.LineTotal else 0 end))
          FROM INV1 T4 WHERE T4.ItemCode=T1.ItemCode ),0)) '2008',
    (isnull((SELECT SUM((case when SUBSTRING((CONVERT(VARCHAR(11),T4.DOCDATE,106)),8,11) like '2009%' then T4.LineTotal else 0 end))
          FROM INV1 T4 WHERE T4.ItemCode=T1.ItemCode ),0)) '2009',
    (isnull((SELECT SUM((case when SUBSTRING((CONVERT(VARCHAR(11),T4.DOCDATE,106)),8,11) like '2010%' then T4.LineTotal else 0 end))
          FROM INV1 T4 WHERE T4.ItemCode=T1.ItemCode ),0)) '2010',
    (isnull((SELECT SUM((case when SUBSTRING((CONVERT(VARCHAR(11),T4.DOCDATE,106)),8,11) like '2011%' then T4.LineTotal else 0 end))
          FROM INV1 T4 WHERE T4.ItemCode=T1.ItemCode ),0)) '2011',
    (isnull((SELECT SUM((case when SUBSTRING((CONVERT(VARCHAR(11),T4.DOCDATE,106)),8,11) like '2012%' then T4.LineTotal else 0 end))
          FROM INV1 T4 WHERE T4.ItemCode=T1.ItemCode ),0)) '2012'
    FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    Group By SUBSTRING((CONVERT(VARCHAR(11),T0.DOCDATE,106)),8,11), T1.ItemCode, T0.CardName, t0.CardCode
    Regards,
    Rahul

  • Sales Analysis Report by Items - How to chart it

    The sales analysis report by items is great for us but I notice that there is no way of getting a bar chart for example at that initial report level. Only when you drill down in to a group does it show the charts.
    Is is possible to get the Items Groups summary sales report in to a chart?

    Hi Ricky.....
    Chart waise Graphical Representation is given by SAP and it can be easily done in XCelcius.
    All you need to do is you have to create your own report and put this report in XCelcius.
    It is recently launched.....
    Regards,
    Rahul

  • Sales Analysis query error

    Experts,
    I have a client show need the Sales Analysis report in one excel file without having to open up each customer line to export this.
    I created the following query, but get the error "Arithmetic overflow error converting expression to data type datetime. 'User-Defined Values' "
    SELECT T0.[DocNum], T0.[ObjType], T0.[DocDate], T0.[DocDueDate], T0.[CardCode], T0.[CardName], T0.[DocTotal], T0.[VatSum], (T0.[DocTotal] - T0.[VatSum]) AS 'Total-Tax', T0.[GrosProfit], (T0.[GrosProfit]/(T0.[DocTotal] - T0.[VatSum])*100) AS 'GrossProfit%'
    FROM OINV T0
    UNION
    SELECT T0.[DocNum], T0.[ObjType], T0.[DocDate], T0.[DocDueDate], T0.[CardCode], T0.[CardName], T0.[DocTotal], T0.[VatSum], (T0.[DocTotal] - T0.[VatSum]) AS 'Total-Tax', T0.[GrosProfit], (T0.[GrosProfit]/(T0.[DocTotal] - T0.[VatSum])*100) AS 'GrossProfit%'
    FROM ORIN T0
    WHERE T0.[DocDate] >=[%0] AND  T0.[DocDate] <=[%1]
    ORDER BY T0.[CardCode]
    Any help in solving this error will be welcome!
    Marli

    Hi Marli,
    Try this:
    SELECT T0.[DocNum], T0.[ObjType], T0.[DocDate], T0.[DocDueDate], T0.[CardCode], T0.[CardName], T0.[DocTotal], T0.[VatSum], (T0.[DocTotal] - T0.[VatSum]) AS 'Total-Tax', T0.[GrosProfit], (T0.[GrosProfit]/(T0.[DocTotal] - T0.[VatSum])*100) AS 'GrossProfit%'
    FROM OINV T0
    WHERE  T0.[DocDate] >=[%0] AND  T0.[DocDate] <=[%1] and T0.VatSum !=0
    UNION
    SELECT T0.[DocNum], T0.[ObjType], T0.[DocDate], T0.[DocDueDate], T0.[CardCode], T0.[CardName], T0.[DocTotal], T0.[VatSum], (T0.[DocTotal] - T0.[VatSum]) AS 'Total-Tax', T0.[GrosProfit], (T0.[GrosProfit]/(T0.[DocTotal] - T0.[VatSum])*100) AS 'GrossProfit%'
    FROM ORIN T0
    WHERE T0.[DocDate] >=[%0] AND  T0.[DocDate] <=[%1] and T0.VatSum !=0
    ORDER BY T0.[CardCode]
    Thanks,
    Neetu

  • Sales analysis report of items not inventoried in utility bill

    Buenas tardes:
    Espero me entiendan ya que mi ingles es un poco malo.
    quisiera saber si hay alguna forma de sacar un reporte de facturas de servicio donde los articulos son del tipo no inventariable, ya que en el analisis de ventas no me permite sacar este tipo de informacion,
    no se si me explique bien.
    Gracias
    Good afternoon:
    I hope you understand me because my English is a little bad.
    I wonder if there is any way to get a report of invoices for service where no type items are inventoried, as in the analysis of sales will not let me get this type of information,
    not if I explain it right.
    Thanks

    Welcome to the forum.
    Yes finding it difficult to understand what exactly your requirement is.  Assuming that you want to see some despatch details where delivery is not made and its like sale order related billing, please check the following TCodes.
    1)  VF05 or VF05N
    2)  MCTE
    3)  MCTA
    4)  MC+E
    Hope my understanding is correct,
    thanks
    G. Lakshmipathi

  • How to Calculate Sales Analysis based on Item

    Hi All,
         I have a problem in calculating the Total Sales,GrosProfit%, TotalOpen,Paid for generating the SalesAnalysisReport based on Items.
    Please tell me how the above fields are calculated(Please post the formulae if u can).
    Thanks & Regards
    Guru.

    Hi.
    From what I know, the Total Sales and Gross Profit are taken from the Marketing Document. You can click the Gross Profit button to check and confirm.
    It will take the Base Price Origin as specified in the Document Setting as the default Cost to calculate Gross Profit. But you can always overwrite it in the Marketing Document.
    In SBO 2004, you need to run the Item Revaluation to ensure correct Last Evaluation Price for Items with Moving Average costing method. In SBO 2005, you have the option of using the Item Cost. There is no need to run Item Revaluation.
    Total Open should be the outstanding while the Total Paid is the amount paid and reconciled.

  • 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

  • Query to match Sales Analysis output exactly

    Hello,
    I have tried several queries to match the output of the Sales Analysis report.  I have done so by customer and by sales employee.  I have failed to create a query that always matches the outcome of the Sales Analysis query exactly.  I would greatly appreciate it if someone could provide such a query even if it just matches net A/R invoice total by date range so that it can be compared with Sales Analysis tool.  From there I can use joins to see other results, e.g., net sales by sales employee by customer.
    Thank you,
    Lang

    Thanks for your response.  Yes, we need to account for credit memos and have already done so.  I had not thought to check for canceled state on invoices though, so thanks for that.  I did a quick query and there were no canceled invoices in the database, however, it will be good to incorporate regardless.  My annual net is close to being correct, but must be exact.  I don't need any other information to be output except net balance, i.e., balance after credit memos, document discounts, miscellaneous expenses recorded in freight field, and ?.  Using doctotal on documents takes into account the document discounts and miscellaneous expenses.  Another way to go is work at the line item level, e.g., INV1 or JDT1, and then account for the document discount and freight (totalexpns).  Approaches that use INV1 linetotal naturally fail on their own since they don't account for document discounts and freight expenses.  At the risk of being redundant, any approaches that don't include credit memos will naturally fail as well.  Here is a few approaches I have tried (that have been almost correct, but not exact, i.e., off by hundreds or a few thousand with net being in the single digit millions):
    Approach #1:
    declare @start datetime
    declare @end datetime
    set @start = '01/01/2008'
    set @end = '12/31/2008'
    select sum(t2.subtotal) from (select t0.doctotal as subtotal
    from oinv t0
    where t0.docdate between @start and @end
    union all
    select -1*t0.doctotal as subtotal
    from orin t0
    where t0.docdate between @start and @end) t2
    Note: this approach was off by a couple hundred dollars or so.  I would like to run this query in B1, but it summarizes a union and that seems to cause B1 to not be able to handle it. It runs fine in any other SQL Server client.  I would rather run it in B1 with dynamically selectable start and end dates, via '[%0]' etc.  The same is true for Approach #2 below.
    Approach #2:
    declare @start datetime
    declare @end datetime
    set @start = u201801/02/2008u2019
    set @end = u201812/31/2008u2019
    Select sum(t5.subtotal) from (Select SUM as subtotal
    From INV1 T0
    Inner JOIN OINV T1 ON T1.DocEntry = T0.DocEntry
    Where T1.DocDate BETWEEN @start AND @end
    Union All
    Select -SUM as subtotal
    From RIN1 T0
    Inner JOIN ORIN T1 ON T1.DocEntry = T0.DocEntry
    Where T1.DocDate BETWEEN @start AND @end
    union all
    select sum(t0.totalexpns) as subtotal
    from oinv t0
    where t0.docdate between @start and @end union all
    select sum(t0.totalexpns) as subtotal
    from orin t0
    where t0.docdate between @start and @end) t5
    Note: the outcome of this is identical to Approach #1. 
    Approach #3:
    SELECT SUM as u2018Net Balanceu2019
    from JDT1 T0
    Inner Join OJDT T1 ON T1.TransId = T0.TransID and
    (T1.TransType = u201813u2019 or T1.TransType = u201814u2019)
    Inner Join OCRD T2 ON T2.CardCode = T0.ShortName
    LEFT JOIN OINV T3 ON T3.TransId = T1.TransId
    LEFT JOIN ORIN T4 ON T4.TransID = T1.TransId
    Where T1.refdate Between u2018[%0]u2019 and u2018[%1]u2019 and T2.CardType = u2018Cu2019
    Note: This query fails because it does not account for miscellaneous expenses recorded in the freight field of invoices and credit memos.  Adding those in is possible, but fails due to the 'Inner Join OCRD T2 ON T2.CardCode = T0.ShortName.  This is because in the case of freight expense journal line items the shortname does not match the cardcode of the BP, but rather the system account it references.  I haven't spent more time to rework the logic of the join to overcome this, but it could possibly be added back in via a union which is subsequently totaled.
    I think I tried a few other approaches as well, but to no avail. 
    A related question/annoyance: I have noticed that certain queries in B1 cannot be executed correctly (they throw an error or have strange behavior like returning only the first row returned) though they can run fine in SQL Server Manager or other SQL Server clients.  Why is that?  It is annoying and unrealistic to have clients have to use another tool for certain queries.  Examples of such queries are those involving cursors, certain summarizing selects that work on a union as input, and queries that contain certain elements of TSQL, like variable declarations (not sure about this last one, but it seems to sometimes cause the query to fail in B1).  I wish I knew how to overcome this so that all queries could run in B1.
    Edited by: Lang Riley on Jan 22, 2009 8:08 PM
    Edited by: Lang Riley on Jan 22, 2009 8:15 PM

  • How to display customer name in sales analysis report (item) layout

    Hi,
    Currently I try to run the sales analysis report by item with secondary selection on customer from & customer to.
    Is it possible for the layout to display the customer from & customer to.
    I try to look for the table name OFLT, but I cannot find it.
    My main concern is to display the customer name in the layout for sales analysis by item.
    Thanks

    Hi,
    The table OFLT stores selection criteria for all form. If there is no customer name/code in system PLD, it is very hard to find table or system variable.
    Tried to get customer name, not successful.
    Alternatively can try to create customized query to get additional field in sales analysis report.
    Thanks & Regards,
    Nagarajan

  • Sales Analysis Report - Items

    Hello -
    We ran the Sales Analysis Report for Items on SAP B1.  It doesn't seem right...the # of items sold is clearly wrong -- it looks like it may be off by over 10X.  Does anyone know what we may have done wrong here?  Did we not set something up correctly?
    Please advise.
    Thanks,
    Mike

    HI Gordon --
    Found out the problem - had orders rather than invoices checked!
    Thanks,
    Mike

  • 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

  • Creating Sales Analysis Report in B1

    Can someone please help me with writing a query to pull Sales Analysis Report sorted and grouped by Sales Employee and Business Partner.
    The report contains the following columns:
    Sales Employee Name and Number, Business Partner Name & Number, Current Month Sales (or the month specified in the report parameter), Same Month's sale last year, YTD-Current Year, YTD-Previous Year
    Also, if you are interested in working on small Business One projects, please contact me with your resume, rate and location. You can work remotely.
    Thanks

    Hi Sam,
    Please check below links and modify according to your requirement.
    Sales Analysis query
    Re:Query for Statewise Sales Analysis Report involving two years..!!
    by below link you can take reference of Queries.
    My Top SQL Queries for SAP Business One
    Hope this helps
    Regards::::
    Atul Chakraborty

  • Sales Analysis report results are being affected (or eliminated) by SQL

    When running Sales Analysis by Item (Item Tab), the client keys in item 15454*
    in the From and To Field and selects the first and last Item Codes listed
    in the result set. The first item code is The results of the Sales Analysis report includes items from 15454-048E-1-41.3 through 15454E-XC-10G.
    The result set stops at itemcode 15454-EIA-SMB-B84 despite that fact that there
    are many items with sales with Item Codes higher than the 15454-EIA-SMB-B84.
    The SAP support rep highlighted that the application is ignoring the dash in it's filtering priority even thought the item lookup is accounting for the dash.  The response is that this is the behavior of SQL server.
    It is true that SQL does ignore dashes and possibly other special characters in sorting nvarchar fields.  However, it is important that the lookup (to select a range of items) and the result set remain consistant in the application regardless of the database/datatype. 
    With no ability to customize (or fix) the report from the field, we are requesting this a a design change.  We recommend testing with all other special characters as to ensure that the report is actually producing accurate results.

    Hi Peter.......
    Welcome to SAP Forum....
    You can try this report which gives you result of Sales Order regardless of Current Status...
    Select * From ORDR T0 Inner Join RDR1 T1 on T0.DocEntry=T1.DocEntry
    Put the desired field in place of * which ever you want in report......
    Regards,
    Rahul

  • Sales Analysis detailed display

    Hi,
    Right now it have to double click on row number to display the detailed of the records.
    Is it possible to display on the same page without double click?
    Thanks

    Hi,
    Please check following threads. Let me know whether meet your requirements:
    Sales analysis report - in query form?
    Sales Analysis query
    Sales Analysis Report by Customer( Monthly)
    Sales Analysis customization query
    Thanks & Regards,
    Nagarajan

Maybe you are looking for

  • How can I create a jar file that will run automatically on double click

    all the jars I created run only from the command-line. how can I make it run by double-click on it?

  • How to associate parent/child elements when extracting values

    Hi, The following is the query to extract data from xml. SELECT row_type      , row_value FROM (SELECT XMLTYPE('                          <rows>                               <row>                               <r>                                    

  • Content server log showing exception in stream

    Hi all, I am connecting to ecm with the follwoing cod eand error on transfere stream is ocurring after connection was paralyesd for about 4 minutes then ecxeption occure then server log shows a service exception the follwoing is the used code PLZ HEL

  • Two audio interfaces but different uses in one system

    Hi, I have already got an audio interface for recording and run smoothly. Recently I get another audio interface (M-Audio Firewire 410). I want to add it to my system as a standalone mixer in which the outputs will be connected to 2 another active mo

  • How to download flash video when a flv extension is not detecable

    Standard methods for saving videos are not working for a particular file I'm trying to save. If you know of a third party app that can download flash video (where the video owner has not enabled viewing of the flv file), please help. Thanks.