Query ( best selling item by gross profit margin)

Hi all,
        Can anyone please provide me a query to generate the reports with below criteria:
1st report: Top 10 selling item
2nd report: Top 10 selling item based gross profit(highest)
Thank you.

Dear Tou,
Use the query below and you can get the top 10 items as well top 10 by total gross value.
SELECT TOP 10 PERCENT T1.ItemCode, T2.ItemName, cast(sum(T1.Quantity) as numeric) as [Quantity sold], sum(T1.LineTotal - T1.VatSum) as [Total Net Value], sum(T1.LineTotal) as [Total Gross Value], T1.Currency
FROM [dbo].[INV1]  T1 LEFT OUTER JOIN OITM T2 on T1.ItemCode = T2.ItemCode
WHERE T1.ItemCode <> ''
GROUP BY  T1.ItemCode, T2.ItemName,  T1.Currency
order by sum(T1.Quantity) desc
Hope this will get your query resolved.
Thanks,
Indraj.

Similar Messages

  • Item Cost as Base Price in calculating gross profit

    Hi All,
    We're using FIFO as item evaluation method. If "Item Cost" has been set up as the base price origin for gross profit, where does SB1 get the value for the gross profit base price for an invoice?
    I know it is not from any price list, and it is not from oitw.avgprice.  Is this item cost calculated using FIFO?
    Thanks in advance.

    Hi,
    Your assumption is correct. It is item cost calculated using FIFO.
    Thanks,
    Gordon

  • Gross profit for service invoices

    Hi Dear;
    how can i set gross profit for the service invoices?
    best regards;

    Hi Dany,
    Currently Business One can only work with Gross Profit on Items. However, in future release 8.8 version, methods for calculating gross profit have been improved. Users can calculate gross profit for both item and service types invoices.
    Regards,
    Candice Ren
    SAP Business One Forums Team

  • No Gross Profit without Delivery Ticket

    We ship product sometimes using a delivery ticket and sometimes we go directly from the sales order to the invoice, bypassing the delivery ticket. On the invoices that do not use a delivery ticket the Gross profit is 100.00%.
    The items are relieved from inventory and the General Ledger posting is correct. It is only the GP reports or from the individual invoice screen that the GP is wrong. We have selected Calculate Gross Profit and Manage Inventory by Warehouse in the document settings.
    Is there a way to calculate GP if a delivery ticket is not used?

    Hi Kathy,
    GP always depends on the base price & this base price is only dynamically recalculated in the target document when you use 'Item Cost'. If you use any other method, the application will pull the base price from the base document.
    There are 2 EES about GP in the archive here:
    https://psd.sap-ag.de/PEC/calendar/
    Enter 'Gross Profit' into the keyword field & tick the checkbox 'Archived Sessions only'.
    All the best,
    Kerstin

  • How to get the Sales A/R Gross Profit to equal the G/L Gross Profit

    Should the sales ledger (S/L) GP base price be set to 'Std Cost List' (SCL) or 'Item cost'?
    If so, the General Ledger (G/L) uses the 'item cost' and the S/L uses the SCL - two different costs.
    If the SCL and item cost are different (for the same item) how do I balance the S/L GP with the G/L GP when producing financial (G/L accounts)?
    Any help or pointing towards help documents would be gratefully appretiated

    Thank you Shwu very much for taking an interest in my problem.
    We are indeed using Standard costing as our preferred stock costing system (not LIFO or MA) and the 'Standard Cost List' (SCL) is a price list that we are using as a list of all the std costs of our items.  Therefore in each item master we set a SCL for an item and then an Item Cost as well (stockdata tab/item cost).
    We were told to do this , as in 2006 when we installed 'SAP V2005', the gross profit base price (S/L base price) could not select the item cost by default. You could also not change an items 'item cost' either. I believe this is not now the case as in document settings the 'base price origin' can now be set as item cost and you can alter the item cost by a stock revaluation p.s. we are now using V2007.
    So indeed as you say, because at the moment the S/L and G/L look at two different figures and if those figures are not the same the S/L GP will never = the G/L GP.
    Scenario 1 - There are a number of reasons why the SCL does not = the Item cost
    1. Price rises - where we altered the SCL but didn't know we could alter the item cost
    2. Incorrect selection of 'item properties' i.e. not ticking an item as stock which means the G/L does not debit the cost at all.
    3. All our manufactured items have an estimated SCL and item cost, but as we dont use BOMs yet, the std cost may not be accurate. (we need to wait till we do a physical stock check)
    4. We use item masters for each of our direct labour sales so the cost is an estimate of their hourly rate + NIC + down time etc. So this is similar to (3) above.
    5. Supplier carriage on 'goods in' cannot be reflected in the item cost as you never know how much the carriage cost is until you recieve the goods. We therefore set supplier carriage as an 'expense' G/L (purchased not stocked item property)
    6. An advantage of using SCL is that you can allow say 10% for wastage or say 5% for carriage cost, whereas you would want the item cost to be the actual purchased cost of the item
    Scenario 2 - Use only the item cost for S/L and G/L
    1. bar for (6) above it now seems to make sense to select only the item cost for S/L & G/L if we want to close the difference between S/L & G/L GP reports.
    2. But I've just been told that a purchase order stamps the SCL cost down not the item cost. very strange, I'll have to look into this.
    I do hope my answers make some sense and once again thanks for helping me

  • Huge and negative  gross profit

    HI experts!
    I have problem with gross profit in Sales Analysis. On each Sales Order, i have some Items which don'nt have item cost ( Item cost =0) and gross profit are caculated 100%. But in Sales Analysis, i got strange result  of gross profit is huge number of gross profit and % gross profit.
    I can nmot explain this. Could you advice me some idieas.
    Thanks!

    Hi
    Check This Threads It will Help u:
    Gross Profit
    Gross Profit
    gross Profit
    Gross Profit !!
    Gross Profit
    Giri

  • Profit margin error at Conditions in Header

    Hi friends,
    I could get the profit margin correctly at each Item level..i.e Net Value minus Intercompany Price.
    Ex- $100 - $80  = 20.
    This I could see at each Item Level.
    But, when I check the same at Header Level , I find the system showing $80 (the intecompany price)..I checked the settings of Intercompany and the Profit Margin..
    They are set to ..Subtotal to -B,  Req- 22 & Profit Margin = Altcly ty- 11.
    Why am I getting this error.? and how to resolve the same?
    Please let me know
    Thank you
    Ravi

    I could solve it

  • Gross Profit

    Hi All,
    When i run the sale analysis report of the system, I wanted to know how does the system calculate the gross profit??
    Thanks in advance,
    Joseph

    Hi Joseph,
    there are 2 EES in the archive. The first one explains how Gross Profit works, the second one gives troubleshooting approaches.
    [Gross Profit|https://psd.sap-ag.de/PEC/calendar/html/recording.php?hck=39ca7ce9ecc69f696bf7d20bb23dd1521b641f806cc7a6b724aaa6cdbffb3a023ff98ae73225156b2c6c9ceddbfc16f5453e8fa49fc10e5d96a3885546a46ef4]
    Gr[Gross Profit II|https://psd.sap-ag.de/PEC/calendar/html/recording.php?hck=d94a45acd81f8e3107d237dbc0d5d195f6a52a0d188bc0284c0763ece1eac9f9496fb6a531a296074c87b3540398dace1222b42e150e67c9301383fde3d66ae5]
    All the best,
    Kerstin

  • Fix incorrect gross profit

    We have several sales that show 100% profit in the Sales Analysis Report.
    We discovered what caused it and have fixed it for the future.
    Is there a way to fix the posted invoices?
    A file that I could import to and update the gross profit number to the correct amount?
    Where does the calculation come from?  example system data for Sales Analysis:
    By Customer: form = 20230  Item = 3  Pane = 0  Column = 5  Row = 7  Variable = 85
    By Item: form = 20238  Item = 3  Pane = 0  Column = 7  Row = 2  Variable = 87
    By Employee: form = 20246  Item = 3  Pane = 0  Column = 5  Row = 3  Variable = 85
    Thank You in advance for your assistance.

    HI Kathy,
    Unfortunately not possible to change GP on posted document in version 2007.
    It will be possible in version 8.8.
    Jesper

  • Calculate gross profit, yearly sales,monthly sales,weekly sales?

    hi all
    i try to create procedures according to these conditions 
    What are my yearly sales?
    What are my monthly sales?
    What are my weekly sales?
    What are my daily sales?
    What is my Gross Profit?
    What is my Gross Sales?
    this is star schema
    now how i calculate yearly sales, monthly sales, and also gross profit.
    create procedure spgrossprofit
    as
    select as grossprofit from dimfact
    now which aggregate function i use for calculate above conditions?
    any help?

    Sorry(ETC) is a Spanish expression = the same for the next option
    The correct query:
    Year/Month
    create procedure spyearlysales
    as
    select sum(totalsales),Year(Dimtime.date) from Dimtime
    inner join Dimfact on Dimtime.Time_Key=dimfact.Time_Key
    group by Year(Dimtime.date)create procedure spmonthsales
    as
    select sum(totalsales),year(Dimtime.date),Dimtime.Month from Dimtime
    inner join Dimfact on Dimtime.Time_Key=dimfact.Time_Key
    group by Year(Dimtime.date),Dimtime.Month
    JM Claudio Dba/Consultor SQL/BI Pasiona - Spain

  • Approval Template by Gross profit Percentage for entire Document

    I'm trying to figure out how to create an approval template that would require an approval if the entire Sales order falls below a minimum gross profit percentage. I did find a built in function that I can require approval if any single line items drop below minimum, but I haven't been able to find a way to either select the gross profit percentage or access the needed fields to calculate the GPP.
    Thanks in advanced

    Hi Nick
    You can give an approval template of the gross profit percentage at the document level in the sales order but not at the row level, it will suit if the condition one to one relationship exists. Thought on the queries and formatted searches might help.
    HTH
    Thanks & Regards
    baskar

  • Possible Bug in DI with Gross Profit? Please confirm.

    The following works:
    1) Add an Inventory Item and set the "Items per Sales Unit" field to "0.1". The "Items per Purchase Unit" is set to "1".
    2) Create a goods receipt for 1 purchase unit.
    3) Create an A/R invoice for 1 unit.
    This should add a line item for 0.1 inventory units and set the price to 0.1 * <itemprice> which it does.
    4) Click on the Gross Profit money bag and everything displays correctly. The journal entry for COGS is also correct.
    What doesn't work:
    If you try the above using the DI API then the journal entry for COGS is correct, but when you find the A/R invoice and click the gross profit money bag then it shows that you sold the item at a loss since it uses the full purchase price unit vs the partial sales unit.
    If you then go an manually add an A/R invoice for the item added through DI API then gross profit calculates correctly.
    There seems to be a problem with the gross profit when you add the invoice through DI API. Is there a parameter when adding SO or AR Invoices that I could be missing?
    System Info:
    SBO 2005 A (6.80.123)
    SQL Server
    Document Settings > Base Price Origin set to Item Cost

    More information:
    After further research I found that the DI API is setting the unit to the Sales Unit (which is correct), but it sets the price to the Inventory Unit price.
    When I set the price via the DI API to what it should be then the discount column was set to 90%.
    Is this by design? If so, what do I need to do to correct this problem?

  • Profit margin - frm_kondi_wert_018 - create billing document

    Hi!
    I want to create a sales billing document with reference to a delivery. The profit margin for one billing item not exceeds a certain limit (calculated in FV64A018, frm_kondi_wert_018) and for some materials the system does not pop-up any message, just calculates the margin. The problem is that when the user creates the billing document, the system issues an invoice number but when he wants to display the invoice, the system issues the error message VF 041: Billing document 90589068 does not exist. (I browsed the table and watched the flow documents and indeed the invoice does not exist.)
    It may be a problem of authorization but I don’t find the missing one (I used SU53). I searched SAP Notes or related threads....
    Do you have any idea? Or some helpful links...
    Thanks guys.

    Hi Florina,
    Oh if that is the case then you can try out one last try by debugging the system with help of ABAPer.This way you can atleast analyse why system is behaving in different way for different logons.
    If it is not traced then you can post this in ABAP forum.
    At times I have faced the same issue.That time the cause was in problem in the output program.User had set the processing time of output as 4-Immediately afetr saving the document.Whereas I was processing with manual release of output.
    So whenever I used to save the document it was getting saved.
    But when the user does the same thing the output is called immediately at time of saving the document and due to error in output program,he used to face this sort of error.
    In user's case he system used to issue the document number but when you go to VF02,document number is not avialable.
    Ask user to remove the output assignment and try saving the invoice.This time if the error is not faced then you need to check the output program.
    Reward points if useful
    Regards,
    Amrish Purohit
    Regards,
    Amrish Purohit

  • Creating a Profit Margin Percentage column in Numbers '09

    I searched around the forums and could not find anything on this topic.
    Basically I am making a spreadsheet for the company I work for and want a column that has our profit margin percentage for a couple of items we sell.
    Problem is, I only have basic knowledge of spreadsheet formulas
    Can anyone help? Thanks!

    plan9
    Hi welcome to the forum.
    The spreadsheets in Pages follow the formating and formulae in Numbers.
    Download the Formulaand_FunctionsUserGuide.pdf from under the Help menu in Numbers.
    Peter

  • Wrong Gross Profit

    Hi All,
    I have created an A/R Invoice, now when I see the gross profit report it shows wrong base price (zero) and wrong gross profit.
    Base Price By was Last Purchase Price.
    I am using Manage by Batch No. option.
    While A/R Invoice I have selected respective Batches.
    But the system has picked up the base price from one transaction which I did not select in Batch selection.
    For particular Item there were 3 Incoming trasactions, 2 were opening balance with respective value and last was also opening balance but with value zero.
    The valuation method is FIFO.
    Can anyone explain me
    1.Why the zero value has been picked up in the gross profit calculation and
    2.How can I correct this value to have correct base value and correct gross profit ?
    Thanks,
    Samir Gandhi
    Edited by: Samir Gandhi on Dec 5, 2008 5:57 PM

    Hi Samir,
    Please give the dates of those 3 Incoming transactions.  FIFO calculation will always pick the earliest possible transaction which haven't be offset yet.
    Thanks,
    Gordon

Maybe you are looking for

  • Moving mail to folders - is it possible to type the name of the folder, vs scrolling?

    Apologies in advance if there is already an answer to this question in the forums; I searched with every combination of the subject I could think of... Context: my iPhone 4 syncs with an IMAP mail server.  I have lots of folders on the server, and I

  • Can't create smart playlists because iTunes can't see all my playlists

    I noticed that my smart playlists aren't updating properly. When I tried to edit them, I got an error message saying "This smart playlist depends on one or more playlists that cannot be found."  I am using as one of my rules "Playlist is" but the dro

  • Windows 8 installation failure

    i'm trying to create a windows partition on my macbook air using bootcamp. the bootcamp assistant made it through the process of creating a usb install disk on a usb drive from a new downloaded windows8 iso, i selected the partition size where you (s

  • Ipod mini coming on automatically

    This is going to sound really weird, but my iPod mini comes on by itself. After I turn it off, even if I put the hold button on, it will come on later and drain the battery all the way down. The next time I go to use it it will be completely dead. I

  • C3-00 stuck call in call log

    Hi, I have the following issue with my c3-00  since yesturday afternoon all of a sudden the call log did not record my calls anymore , none of them missed, received dialed. it showed me all the calls up until yesturday afternoon. I went and deleted t