Need month wise report in a row

Hi,
I need to produce a report where i need to sum up data for a particular month and display it in a row. How can i go about doin this?
For e.g.
QTY in jan, QTY in feb, QTY in mar, QTY inapril,.....
1000 100 5000 10

LostWorld wrote:
SELECT cust_acct.account_number
cust_acct.segment1 part_nbr,
SUM(decode(to_char(rct.trx_date,
'mm/rrrr'),
to_char(add_months(SYSDATE,
-1),
'mm/rrrr'),
nvl(ctl.quantity,
0))) AS qty_01,
SUM(decode(to_char(rct.trx_date,
'mm/rrrr'),
to_char(add_months(SYSDATE,
-1),
'mm/rrrr'),
nvl(ctl.quantity_invoiced,
0))) AS qty_02
FROM ra_customer_trx_all rct,
ra_customer_trx_lines_all ctl,
hz_cust_accounts cust_acct
WHERE rct.customer_trx_id = ctl.customer_trx_id AND>> GROUP BY cust_acct.account_number,
cust_acct.segment1,
to_char(rct.trx_date,
'mm/rrrr')
This is the kind of report i want.
This will give me sum of qty for a given month for an account number and segment ID.What is the error you are getting?
GROUP BY wont make any problems here..
SQL> create table test(account_number varchar2(15),segment1 varchar2(10),quantity number,quantity_invoiced number);
Table created.
SQL> select * from test;
ACCOUNT_NUMBER SEGMENT1 QUANTITY QUANTITY_INVOICED TRX_DATE
99999           2                5000              5000 20-SEP-08
12345           1                  50                45 20-SEP-08
12345           1                 500               450 20-SEP-08
99999           2                 200               250 20-SEP-08
SQL> SELECT account_number,segment1 part_nbr,
  2        SUM(
  3           decode(to_char(trx_date,'mm/rrrr'),to_char(add_months(SYSDATE,-1),'mm/rrrr'),
  4                    nvl(quantity,0))
  5           ) AS qty_01,
  6        SUM(
  7           decode(to_char(trx_date,'mm/rrrr'),to_char(add_months(SYSDATE,-1),'mm/rrrr'),
  8                    nvl(quantity_invoiced,0))
  9               ) AS qty_02
10  FROM test
11  GROUP BY account_number,segment1,to_char(trx_date,'mm/rrrr');
ACCOUNT_NUMBER PART_NBR QTY_01 QTY_02
12345           1                 550        495
99999           2                5200       5250
You are missing AND condition.. Did you check that?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Sales voluem monthly wise report

    Hi BW expert,
    I need a repor like apr09,may09,june09 Q1, apr08,may08,june08 Q1 LY. but i restricted apr, may june on posting period its displaying only q1 . i need monthly wise like apr08,may08,june08.i searced this forum as per requirement its not displaying plz any one idea on this how to get montly wise .
    Regards
    ramakrishna

    Hi
    Yes, it is possible to compare the sales for two different periods (be it date, month, quarter, half-year, full year, etc.).   I used the fields "Calendar Year /Month period 1" and "Calendar Year /Month period 2" and also added a formula to show the growth in terms of percentages.    And it is working well in my company.
    In fact I designed the query in the following way:-
    1.   Month - (single month - say Sept. 2009)
    2.   Month - (single month - say Sept. 2008)
    3.  Months - (Jan/Sept. 2009)
    4.    Months - (Jan/Sept. 2008).
    In the query I have made a comparison of sales, ie. sales of Sept. 2009 compared to Sept. 2008 and Sales of Jan/Sept. 2009 compared to Jan/Sept. 2008.   
    All the above done in a single query.
    Regards
    Jayan
    Bangalore, India

  • How to monthly wise  report in XL -Reporter

    Hi,
    How to define monthly  wise report &
    How to use date function in XL-Reporter.
    thanks.
    Ruheena Tasneem

    Dear Rubeena
    You can define parameter Date as follows
    In Advanced Report Builder Select Parameter
    a window will be opened, There Click New
    Name         Category         Type      Attribute            Default Value            Prompt
    Sdate         Literal             Date                                                              Enter Starting Data
    Edate         Literal             Date                                                              Enter End Date
    Regards
    Rashid

  • Month wise Report issue

    hi,
    in my RTF template i am showing the data,as group by month here i want the report should show data starting by
    the report should show as below format month by month any please help me
    Jan
    ------------rows in the month of Jan------------
    Feb
    ------------rows in the month of Jan------------
    Mar
    Apr
    Jun
    Jul
    Aug
    Sep
    Oct

    Can we see the xml data ?
    if you can paste here , thats good, or drop me mail, will have a look at it.

  • Monthly wise sales report

    hai,
         i m working on sales report where in i need to get month wise sales of the products and the related cost incured to company by the sales in the matrix form as shown below  can u help me in which way can i get this monthly report
              march     april     may   june    july......feb
    mtrl    25            30         0       19      23   ........(mtrl quantity)
    cost   30000     15000      0      45000  ..........(amt in rs)
    where in the above i m able to get yearly sales in one column (i.e i m able to show for one particular customer total sales in one column) but i m unable to split sales monthly and unable to show in a report so how can i able to sow in this matrix form

    Dear Raj,
    Please find the code for monthly wise report in PA0001 Table for calculation of Administrator time Recording.
    http://scn.sap.com/message/14216250#14216250

  • Project wise report

    Hi,
    I need Project wise report can i get it.If so how can i do

    Hi sandy,
    I think there three possibilities of genereating cashflow report by project:
    1. Create a cashflow report in XL Reporter
    2. Create a user query from query generator
    3. Build your own report via SQL query and SDK package
    Anyway you should choose XL Reporter (1) if you don't have to much time develop your own.
    or
    Start Tx SE38
    Run Program RSWB0006
    Either Add or Amend the Attribute SAP_CTS_PROJECT
    Select Attribute Value Obligatory .
    thanks
    abdul

  • Period wise report - FAGLB03

    Dear Experts,
    We need period wise report for this transaction code (FAGLB03).
    Is there any possibility.
    Thanks
    Balu

    Hi,
    In addition to the above suggestion , you can copy standard program and create zprogram by adding period filter in program and selection screen as required.
    Regards
    Milind Sonalkar

  • Cost Center wise Report

    Hi,
    How to display monthly expenditure related to a Cost Center. I tried the standard report but there it is showing accumulatived figure for 12 months. But I want to show monthly expenditure related to a Cost Center.
    General selections:
    Controlling Area - XXXX,
    Fiscal Year - 2009,
    Posting Period from -1 to - 12,
    Cost Center - 1000
    Then it should like below format.
    Cost Element            APRIL       MAY     JUNE        JULY ...............   TOTAL YEAR
    Stationery                10               -           50              -                                 60    
    Salaries                   150          125           -             225                             500
    Admin Exp.              25             10            -               -                                 35
    TOTAL                    185          135          50            225                            595
    If we select only 2 months, then only 2 months expenditure should be display in the above format. I tried the in the report painter but if I am selecting the Period in the column then it is not coming in the General selections. If I am selecting Period under General selections then in the report it is shoing cumulative figure.
    So can some one please through some light on this.
    Thanks in advance.
    Rams N

    Hi Pawan,
    I copied the Standard Report from 1VK. Problem is, My clinet wants to select give the Transaction date in the general selection and then he want to see the same in the month wise report. For ex.
    Controlling are - XXXX
    Period or Date - 01.04.2009 to 31.05.2009
    Cost Center - 1000 and Execute.
    Then Report should be display APRIL and MAY expenditure seperatly. This is the requirement.
    My problem is, if I am selecting the period in the column then I am not able to specify the same in the general selection.
    Thanks & Regards,
    Rams N

  • Need information in Year wise report

    Dear All,
    I am doing year wise report, in that i got total quantity for every month.
    But my problem is if there is no transaction in that month i didn't get for that month, i need that month with total quantity is 0.
    Please help to solve this issue.
    thanks & Regards
    Adina

    Try this..
    SELECT sum(po.No_POS) over(order by mths.dt) Quantity ,
           to_char(trunc(mths.dt,'MM') , 'MON-YYYY') "Month"
    from
        (select count(poh.segment1) No_POS
              , to_char(trunc(poh.approved_date,'MM') , 'MM-YYYY') Month_PO
         from po_headers_all poh
         where poh.type_lookup_code='BLANKET'
         and poh.approved_flag='Y'
         and poh.approved_date>=nvl(:P_FROM_DATE,poh.approved_date)
         and poh.approved_date<=nvl(:P_TO_DATE,poh.approved_date)
         group by trunc(poh.approved_date,'MM'))po,
        (SELECT add_months('01-DEC-2005', lvl) dt
         FROM (select level lvl
               from dual
               connect by level < 1000)) mths
    WHERE to_char(trunc(mths.dt,'MM') , 'MM-YYYY')= po.Month_PO(+)
    and mths.dt between :P_FROM_DATE and :P_TO_DATE
    order by mths.dtMessage was edited by:
    jeneesh
    Tested Like..
    SQL> select * from po_headers_all;
      SEGMENT1 APPROVED_
             1 28-SEP-07
             2 23-SEP-07
             1 09-AUG-07
    SQL>  SELECT sum(nvl(po.No_POS,0)) over(order by mths.dt) Quantity ,
      2          to_char(trunc(mths.dt,'MM') , 'MON-YYYY') "Month"
      3   from
      4       (select count(poh.segment1) No_POS
      5             , to_char(trunc(poh.approved_date,'MM') , 'MM-YYYY') Month_PO
      6        from po_headers_all poh
      7        --where poh.type_lookup_code='BLANKET'
      8        --and poh.approved_flag='Y'
      9        --and poh.approved_date>=nvl(:P_FROM_DATE,poh.approved_date)
    10        --and poh.approved_date<=nvl(:P_TO_DATE,poh.approved_date)
    11        group by trunc(poh.approved_date,'MM'))po,
    12   --date is changed here and no extra subquery needed
    13       (SELECT add_months(sysdate-365, level) dt
    14        from dual
    15   --dates are HARDCODED here
    16        connect by level < (months_between(sysdate,sysdate-365)+1)) mths
    17   WHERE to_char(trunc(mths.dt,'MM') , 'MM-YYYY')= po.Month_PO(+)
    18   order by mths.dt;
      QUANTITY Month
             0 OCT-2006
             0 NOV-2006
             0 DEC-2006
             0 JAN-2007
             0 FEB-2007
             0 MAR-2007
             0 APR-2007
             0 MAY-2007
             0 JUN-2007
             0 JUL-2007
             1 AUG-2007
             3 SEP-2007
    12 rows selected.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Monthly wise Sales report - Help me

    Dear SDN mates
    Is there any standard reports for Monthly wise sales report ...the SAP1 , SAP2 reports were not helpful....Does this can be solved by standard reports or it needs to be customized????
    kindly help me?

    hi,
    check VC05 transaction.

  • GRR3 report is not showing cost centers monthly wise totals

    Hi,
      we are having cost center report for full year company code currency report which was working in R3 system. after upgrade it is not showing monthly wise total currency values but when drill down it to actual line item level it is showing all totals. can anybody hlep me to identy issue.
    Thanks,

    Dear Venu
    Check any other standard summarisation report and see whether they are giving data or not. If not you need to implement note 1817039 to fetch summarisation data. But before that I suggest once again you do data collection upto the period and try running your report.If no success then read the note and apply it.
    Regards
    Rajneesh Saxena

  • Stock report with value and qauntity for given date not month wise

    Hi gems,
    can any body give me the standard report for Stock value and qauntity for given date not month wise at storage location level

    Hi
    check the report S_P00_07000139 with the option inventory and raw material report- detail and selection date (from, to date same). List will give opening & closing balances with goods movment and their values.
    Thanks

  • Report to view the batch details of the products sold month wise

    Report to view the batch details of the products sold month wise.
    Please send it .

    Dear Goutam
    Use <b>MB51</b> where you can select the field "Batch".
    Thanks
    G. Lakshmipathi

  • ANNUAL SALES REPORT (MONTH WISE)

    Hi,
    I have following query, which shows annual sales (month wise). But when i run this query it shows all the parts (my mass production and Spare parts as well). I want it should show only MASS Production items only.
    The differencation i have specified at Item level property. If item property no. 5 (name SPARES) is check then it is SPARE item otherwise it is MASS Production.
    Thanks,
    Vincent
    ======================================================
    SELECT T0.ITEMCODE, T0.ItemName, T0.U_MODEL,
    (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())) AS 'JAN QTY',
    (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())) AS 'FEB QTY',
    (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())) AS 'MAR QTY',
    (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())) AS 'APR QTY',
    (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())) AS 'MAY QTY',
    (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())) AS 'JUN QTY',
    (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())) AS 'JUL QTY',
    (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())) AS 'AUG QTY',
    (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())) AS 'SEP QTY',
    (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())) AS 'OCT QTY',
    (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())) AS 'NOV QTY',
    (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())) AS 'DEC QTY'
    FROM dbo.OITM T0
    LEFT JOIN dbo.INV1 T1 ON T1.ItemCode = T0.ItemCode
    WHERE T0.SellItem = 'Y'
    GROUP BY T0.ItemCode, T0.ItemName, T0.U_MODEL, YEAR(T1.DOCDATE) HAVING YEAR(T1.DOCDATE) = YEAR(GETDATE())

    Hi Rahul,
    Yes this report is very much available, but my idea was to integrate an udf (Model No., which i didn't specify in this query).
    But yes this report is very usefull for me.
    Thanks
    Vincent

  • Monthly wise GR and GI report

    I have to make report in which i have to show the quantity and value of Goods Receipt and Goods Issue monthly wise for a particular material. How can i do this. Plz help........

    Its a good report which show the details on date wise and balance quantity and value.
    I want to show the same report for quantity and value of material but in monthwise or period wise like
    In Quantity
                   Opening stock        Goods receipt              Goods Consumption          Closing stock
    Jan                 15                           20                                     10                                25
    Feb                  25                          45                                      20                               50
    Mar Apr May......till Dec

Maybe you are looking for

  • How do I stop Safari from closing unexpectedly on my Mac OS X Version 10.5.8?

    This is what is listed in Problem Details: Process:         Safari [4522] Path:            /Applications/Safari.app/Contents/MacOS/Safari Identifier:      com.apple.Safari Version:         5.0.6 (5533.22.3) Build Info:      WebBrowser-75332203~3 Code

  • To find only master data process chains and its infopacakges!!!!

    Hi, I have a task to remove the setting in the scheduler of directly assigning to data targets instead of  PSA and then to data targets of the whole system!!! i should not touch though the transactional info packages settings!! these infopackages mus

  • Anyone for poplog?

    It is the language developed allot at Sussex Uni, If you wan't to get it working I can post a howto about how I bashed it together. Does AI and stuff like that as well as being able to do a factorial of 1000 instantly and more importantly very accura

  • Error layout query

    Hi guys, my problem is this:I have built a query and in the output format I have selected the choise 'SAP list viewer' but before run I have noticed that in the screen in label output specification I could not see other choises(Abap list,grapich,file

  • Adobe AIR Application Distribution

    I have a client that requested me to do them a CD application which I am thinking of using Adobe AIR. Does the distribution license allow Adobe AIR applications made using Flex or Flash be published through CD-roms and for downloads? Are there any im