Need help with extracting sales data

Hi all,
We want to get a list of net sales (invoice minus credit notes) per customer by Item Group. This would look like:
Customer Code | Customer Name | Item GroupA | Item GroupB | Item GroupC etc..
The data appears to be in the Sales Analysis Report if we select the Items tab and use "Group Display" and "Total By Customer". However the format of that is different to the above.
Can anyone suggest either:
- how to do the same thing via query
- how to best convert the standard output into the above format (perhaps some Excel trickery?)
Thanks in advance,
Raj

Hi Raj,
Try this query. You change the tables as per your needs.
select OCRD.CardName ,
case when OITB.ItmsGrpCod  = 103 then SUM(doctotal) else 0 end as 'Amplifier (AMP)',
CASE when OITB.ItmsGrpCod  = 104 then SUM(doctotal) else 0 end as 'Audio Tech (AUT)'
from ocrd inner join oinv on ocrd.cardcode = oinv.cardcode 
inner join nnm1 on oinv.series = nnm1.series 
inner join inv1 on oinv.docentry = inv1.docentry 
inner join OITM on OITM.ItemCode = INV1.ItemCode
inner join OITB  on OITM.ItmsGrpCod = OITB.ItmsGrpCod
where oinv.docdate >= CONVERT(DATETIME, '4/1/2011', 102) 
and oinv.docdate <= convert(datetime,'3/31/2012',102) 
and ocrd.cardcode = 'CA0163'
group by OCRD.CardName , OITB.ItmsGrpCod 
Union 
select OCRD.CardName ,
case when OITB.ItmsGrpCod  = 103 then SUM(-doctotal) else 0 end as 'Amplifier (AMP)',
CASE when OITB.ItmsGrpCod  = 104 then SUM(-doctotal) else 0 end as 'Audio Tech (AUT)'
from ocrd inner join orin on ocrd.cardcode = orin.cardcode 
inner join nnm1 on orin.series = nnm1.series 
inner join rin1 on orin.docentry = rin1.docentry 
inner join OITM on OITM.ItemCode = RIN1.ItemCode
inner join OITB  on OITM.ItmsGrpCod = OITB.ItmsGrpCod
where orin.docdate >= CONVERT(DATETIME, '4/1/2011', 102) 
and orin.docdate <= convert(datetime,'3/31/2012',102) 
and ocrd.cardcode = 'CA0163'
group by ocrd.CardName , oitb.ItmsGrpCod
order by 1,2
Thanks
Malhaar

Similar Messages

  • Need help with comparing Query data

    See Attached query
    I need to only show Sales Employee Name that does NOT match Email
    Example: Sales Employee Name KSLM-130
                      E-Mail does NOT start with the same KSLM-130 @ XXX.com
    In other words need to report on unmatched Sales Employee Name to Email Name.
    Thank you!

    Hi!
    Try this. It might work for you.
    SELECT
    T0.[CardCode], T0.[CardName], T2.[SlpCode], T1.[Name], T1.[E_MailL], T2.[SlpName]
    FROM OCRD T0 
    INNER JOIN OCPR T1 ON T0.CardCode = T1.CardCode
    INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode
    WHERE LEFT(T1.[E_MailL],LEN(T2.[SlpName])) <> T2.[SlpName]
    Regards,

  • Need help with loading master data from R/3 to BI 7.0.

    Hi,
           First i thank everybody who took efforts to answer for my posting, i really am learning this new version with your helps. I really appreciate  it.
    Could any one help me with a step by step process to load master data from R/3 to BI 7.0. Please don't send help.sap.com.
    will assign points .
    With Thanks,
    Ranjani R

    Hi,
        Thanks for the answers. I tried loading it yesterday, i had lot of confusions.
      What should i do to load a master data from a R/3 to BI7.0.
    1. Created a Info object named (EKKO_mas) with some attributes (ernam, ekorg, lifnr).
    2. Go to info provider and right clicked on info area and selected insert char as data target. (Please correct if i am wrong).
    3. Login to R/3, go to sbiw generic data source created one with a view/table as EKKO and map the application compound and select the needed fields by checking the checkbox. (please correct if wrong).
    4. Go to source system tab and replicate data source. ( Please correct if i am wrong)
    Then what should i do.
    guessing steps:
    4. Create a Data source, in BI 7.0 . In that as i am not using flat file, should i select "application server" instead of "local workstation" . In field tab i specified all the fields given in Info object. ( Will there be anything else i should do or change in this tab)
    5. Load data in PSA. ( will the data from R/3 i selected loaded in PSA without any problem)
    6. Create transformation , save and activate.
    7. Create DTP save and activate , click execute.
    By doing the above given step will i be able to load the master data from R/3 to BI 7.0 data target (IO) .  Please help me if something is wrong with my steps.
    Thanks.
    RR.
    *will assign points.

  • NEED HELP WITH TRANSFERRING P2 data from the HVX camera to FCP!!!

    Hey guys...
    Need some emergency help here... I'm trying to transfer my data from the P2 card on the HVX camera to my FCP6. I plugged in my 1394 firewire cable into the deck and followed the directions but the computer is not recognizing the HVX camera. PLEASE HELP!!!
    Jeremy

    They come with the camera on the Installer CD. OR....
    https://eww.pavc.panasonic.co.jp/pro-av/support/desk/e/download.htm#p2pcdriver
    http://panasonic.sixbullets.net/
    Shane

  • Need help with sql query dates

    Hi,
    I have a sql query where i need to extract some info between given dates. The where clause of this query is as follows:
    WHERE CPD_BUS_UNIT=:ESI_PRM_1
    AND CPD_VOUCHER_DATE >= :P_DATE_FROM
    AND CPD_VOUCHER_DATE < (:P_DATE_TO+1)
    When i execute the query in toad, i can view the data but not the execution plan.It gives an error ORA-00932-Inconsistent Datatypes.
    But when i remove (+1) from :P_DATE_TO, i can c the execution plan and data. Will the data be different from the previous one.
    Please suggest how to rewrite the query.

    Can you please give it a try?
    WHERE CPD_BUS_UNIT=:ESI_PRM_1
    AND CPD_VOUCHER_DATE >= :to_date(P_DATE_FROM)
    AND CPD_VOUCHER_DATE < (to_date(:P_DATE_TO)+1) Regards

  • Hi I need help with extracting audio.

    Quick question, I have this music track that is basicaly a repeating beat with guitar riffs that play on top. Is there any way, using Soundbooth, that I can extract the two elements (Beat/Guitar) into seperate tracks so that I could edit them seperatly?
    Thanks
    John

    It will definitely be difficult with Soundbooth, and depending on the source file, most other applications as well.  Soundbooth doesn't have a Center Channel Extraction tool like Audition, so your options would be to use a different tool in an unexpected manner, or to perform some time-consuming manual extraction.
    If the file is such that the beat exists on one channel and the guitar on the other, select File > Export > Channels to Mono Files.  This is probably not the case, unless it's an old Dylan or Beatles recording.
    Second, I might try selecting one loop of the beat with no guitar, and capturing this as a Noise Print.  (Find this under Tasks > Clean Up Audio.)  Once captured, select the entire file and apply a noise reduction.  There is a (very) slight possibility this process will isolate the guitar.  after saving the guitar as a new file, undo the noise reduction so you have your original file again, open the guitar file and capture the entire thing as a noise print, and apply this to the original file in Noise Reduction.  Ideally, you would be left with the beat.  Place these two files on separate tracks in Multitrack and you might get something that resembles the original track, but that allows you to modify levels or place effects on the beat and guitar separately.
    Now, odds are very high that this just won't work, either.  The Noise Reduction tool is not a scalpel for removing sounds, but is a fuzzy and dynamic tool to remove audio data that doesn't appear to belong.
    You could also go back to your original file, open Soundbooths Spectral Frequency view be selecting Tasks > Remove a Sound, then use the lasso tool to painstakingly select the orange and yellow areas that represent the guitar parts, cut this selection and paste it into a new file of the same duration.  When layered in multitrack, they would sound identical to the original file, but you'd have some control over the beat and the guitar part.  This however, is still not ideal since any frequencies in the beat that overlapped the guitar would be moved to the guitar track.  It would also be a TON of work.
    So to save you time, I would highly recommend using a more advanced audio editing tool such as Audition.  If you're using Windows, you can download a free 30-day trial at adobe.com.  Using the center channel extractor effect, you can zero in on where the guitar part is panned in the stereo field and strip it out to a new file.
    Good luck

  • Hard problem. need help with contact file (data.syncdb)

    hello everyone. i lost my iphone. i have the data.syncdb file.
    how can i view this?
    if i cannot view it can i send it to someone and they can replace their file on a old iphone (if someone has one) or touch? then they can see the contacts and email them to me? i would paypal you some $$ to help me out. i dont have much just need the contacts bad.
    any help would be great.
    Thanks!

    anyone?

  • Need help with extracted text

    I am fairly new to CS4 and I extracted low resolution text to place on a new background. The text is important as is but I need to know how to clean up the text and make it better. After I place it one the background, it is not as clear, sharp, and vibrant as I need. I tried doing a color overlay and I also tried placing a style on it(cannot find one good for black text) but still it is not good enough. Any ideas how to make the black text better? I really need it as soon as possible...thanks everyone.
    Melissa

    You may never get it to a good quality.
    Can't you type it out again in a similar font?

  • Need help with Extract in CS2

    extract is not working on cs2 for me.  I can only extract if I use the force foreground and then its just washed out

    Could you post an example picture?
    You probably already know this, but you used the Edge Highlighter Tool to draw an outline around the part you want to extract
    and then clicked inside the outline with the Fill Tool and then clicked on the Preview button to see how the extraction looks?

  • Need help with extracting a faint reflection from a window with Photoshop CS6, from a jpg photo

    I was wondering what tools are needed to be used to extract a clearer image of a reflection in a photo.
    I am using Photoshop CS6 (64 Bit).
    I don't know what else I should add. Please ask, and I will answer as much as I know.
    Regards,
    Isa

    Semaphoric
    I asked the photo owner and was told that they don't want their picture posted in public. So, I can't provide that specific image.
    Perhaps if you may, could you please find a picture of a person reflected in a window (shopfront) and see if you can make the reflection of the person anymore clearer?
    Here, watch this video for a better idea of what I am after: CSI Magic
    I am the first to admit that this video clip is a far-fetched possibility (read, impossible from such a distance and angle), but a reflection from a much closer object (it was of a lady taking a photo around 2 metres/6 feet in front of a shopfront, to get her friend some contact details. She is [not so] clearly visible within the reflection), may be able to grab more of her details from the reflection.
    I almost feel like going out and taking a picture myself to describe the situation more thoroughly, as I believe the way I worded my initial request may be misleading, as chilecayenne seemed to be misled by it. However, if anyone else could take/provide such a photo, and post it up here, I would really appreciate it.

  • Need help with some Coldfusion data structures

    Hello,
    I need to keep some sort of a list that contains a page, and then that page will have associated with it values.  So,
    if I have page 1, I may have values 240, 245, 300.  Then, on to page 2, and I will have say, 344, 29, etc.
    So, what I will have is something that "could maybe" be a 2 dimensional array where one of the elements is a list?
    Or, do I set up a struct say, page.number and page.value list, and put that struct in an array?
    Plus, the fun part is I have to save this bad boy in session.  I've been looking around the web for some examples, no
    luck.  So, to reiterate:
    I have a page number that has to be associated with a list.  That entire structure needs to be in an array or list of
    some sort, and stored in session.
    Thanks in advance!

    Really Google did not show anything like:
    <cfset session.pageAry = [
         {page="pageOne", numList="240,245,300"},
         {page="pageTwo", numList="344,29"}]>
    <cfdump var="#session.pageAry#">
    OR
    <cfset session.pageAry = arrayNew(1)>
    <cfset arrayAppend(session.pageAry, strutNew())>
    <cfset session.pageAry[1].page = "pageOne">
    <cfset session.pageAry[1].numList = "240,245,300">
    <cfset arrayAppend(session.pageAry, strutNew())>
    <cfset session.pageAry[2].page = "pageTwo">
    <cfset session.pageAry[2].numList = "344,29">
    OR
    The <cfscript> version of these examples.

  • Need help with returning NULL data using DECODE

    Hello again! I am new to PL/SQL and still fairly new to SQL. I have a query that returns several columns of data and based on the year entered I want either current data or past data. If the number is null that is considered current data only.
    Below is part of my where clause, it kinda of works the way I want. It is returning the correct numbers but it is not returning any null numbers when I enter 2007 for the current year. I hope this makes sense, any suggestions/tips would be great thanks!
    WHERE table1.num = decode(table1.num,
    null,
    decode(:p_year, to_char (current_date,'yyyy'),
    table1.num,null),
    decode(:p_year,(select to_char(open_date,'yyyy') from table2 where table2.num = table1.num),
    table1.num,null))

    maybe something like this?
    WHERE Nvl(table1.num,'x') = Decode(table1.num, null, Decode(:p_year, to_char(current_date,'yyyy'), table1.num, 'x'),
                                                         Decode(:p_year, (select to_char(open_date,'yyyy') from table2 where table2.num = table1.num), table1.num, 'x')) note: untested

  • Need help with CKFs on dates - cycle time analysis

    Hi Experts,
    I have two CKFs (date type) in Columns of my BEx query.
    Lets say "START DATE" and "END DATE".
    I have a formula (lets say DATEDIFF) in rows which calculates "END DATE - START DATE"
    Also, I have Customer and Document# in Rows.
    When I run the query, I receive the correct values for DATEDIFF.
    But, when I rollup the report by removing drilldown on Document#, I'am receiving incorrect DATEDIFF values.
    Please let me know how can I solve this issue.

    Hi Dev,
    The dates are depend on customer and documents in your case.
    let us consider you have two records which are shown below in your report.
    CUSTOMER|DOCUMENT|DATEFROM|DATETO|DIFF
    C1|D1|01.01.2008|03.01.2008|2
    C1|D2|05.01.2008|10.01.2008|5
    From the above example if you remove document from the result, then there is no meaning to you report.
    If you remove the document from the result, could you please let me know what is the output you are expecting??? is it the below mention output
    C1|01.01.2008|10.01.2008|9
    Please go thought your requirement once again.
    If I am wrong in understanding your requirement, correct me please.
    Regards,
    Patil.

  • I need help with extracting from my home movie

    I made a home movie 3 years ago in idvd. How can I extract one of the scenes and post it on my web page,
    Mike

    As a movie or as a still frame?
    Consider DVDxDV from http://www.dvdxdv.com/DVDxDV.overview.htm to extract a movie
    or
    Snapz Pro x from http://www.ambrosiasw.com/utilities/snapzprox/ to extract still frames (and since it can also capture movies from your computer screen, you could also use it instead of DVDxDV to capture a movie clip for web use).

  • Need help with server / client data

    i have a java server that sends strings to a client
    when i use telnet it works fine
    but with a java client it only recieves one line and then disconects
    any ideas?

    post the client and the server code plz

Maybe you are looking for

  • W530 Verde Drivers

    When I had my W520, I had installed the Verde Drivers from nVidia's website. I tried the same thing with My W530, which has the Quadro K2000M Graphics Card. I got a lovely message that said something along the lines of "Installer could not find a com

  • I can't create filename "AUX"

    Hi, Any one tell me that I can't create a file name "AUX" Why its so.

  • LOV Display Issue

    Hi,       We are using jDeveloper 11.1.1.7.0 .       We had a very long LOV displayed in the page. Under the resolution 1280*768, it goes out to the right of the page, and becomes really ugly.       We have 6 fields as the LOV's display attributes. I

  • [SOLVED] Netbooting with PXE, TFTP and NFS / Numerous errors

    Greetings all, hope you can help me out. Been given a task by my company of making a network bootable ICA client (with X and Firefox, with the Citrix ICA client installed) as small as possible to minimize network traffic (as 440 workstations would be

  • Time Machine Hung Up

    I set up Time Machine to a Seagate Free Agent Drive about 5 weeks ago. It's worked fine until recently; I noticed yesterday that the TM icon was continually spinning, & when I go into TM Preferences it shows that it is backing up "1 kb of 42 kb". Abo