Average for Unit Price within a date range????

Howdy BI Gurus,
We're on BI 7.0.
The client has the following report that I neeed to create in BI:
It's Determines the Average Costs for Raw Material Every Quarter:
<b>Item #  |   Receipt Date|   Qty      |    Unit Cost  |   Extended Cost  |   Vendor</b>
200TU      | 01/23/07        | 47,349   |      .9950      |   47,112.26         |      XYZ
200TU      | 02/19/07        | 48,796   |      .9870      |   48,552.02         |      XYZ
200TU      | 04/16/07        | 43,978   |      .9340      |   43,758.11         |      XYZ
Total Sum  For Qty =  140,123
Total Sum For Extended Cost = 139,422.39      
Average  For Unit Cost =   .9720
1. How do you calculate the <b>Average</b> for the <b>Unit Cost</b>?
2. How do display the Total Sum ONLY for the <b>Qty</b> &&<b> Extended Cost</b>?
I tried the following document:
<b>"How to...Count the Occurances of a Characteristic"</b>
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7e58e690-0201-0010-fd85-a2f29a41c7af
...that was posted on another forum that shows step by step how to create a Counter infoobject and update the transfer rules with a Constant "1" and after creating a CKF in Query Designer and setting up the Exception Aggregation for "Average of All Values" for Ref. Characteristic "Material" to get the average...Unfortunately, it didn't work for me as I just get $0.0. 
I'm thinking maybe the directions were for the old BW version.
Any help would be greatly appreciated.
Best Regards,
Osman

This is what I get now when I do an Exception Aggregation on Ref. Char - Material...Look at the last Column titled "Average Unit Price"
Calendar Day     Material     Individual price in invoice     Invoiced quantity     Extended Cost     Average Unit Price
10/9/2007     17887          $ 14.00 /EA               7,128 EA          $ 99,792.00     $ 14.00 /EA
10/22/2007     53093          $ 318.00 /EA               1,920 EA          $ 610,560.00     $ 318.00 /EA
10/8/2007     4750MT          $ 0.51 /LB               252,000 LB          $ 128,088.00     $ 0.51 /LB
10/9/2007     4750MT          $ 0.51 /LB               252,000 LB          $ 127,638.00     $ 0.51 /LB
10/17/2007     G202          $ 59.40 /EA               6 EA               $ 356.40     $ 59.40 /EA
What I want is grup by Material:
Calendar Day     Material     Individual price in invoice     Invoiced quantity     Extended Cost     
10/9/2007     17887          $ 14.00 /EA               7,128 EA          $ 99,792.00     
Average Individual price in invoice = $14 (Since there is only 1)
10/22/2007     53093          $ 318.00 /EA               1,920 EA          $ 610,560.00     
Average Individual price in invoice = $318.00 (Since there is only 1)
1/8/2007     4750MT          $ 0.51 /LB               252,000 LB          $ 128,520.00     
2/9/2007     4750MT          $ 0.32 /LB               252,000 LB          $  80,640.00     
3/10/2007     4750MT          $ 0.24 /LB               252,000 LB          $  60,480.00     
4/25/2007     4750MT          $ 0.65 /LB               252,000 LB          $ 163,800.00     
Average Individual price in invoice = (($0.51 + $0.32 + $0.24 + $0.65) / 4) = $0.43
10/17/2007     G202          $ 59.40 /EA               6 EA               $ 356.40     
Average Individual price in invoice = $59.40 (Since there is only 1)
Hi Kartikey,
I'll try your method tommorrow morning...thank you for your help so far.
I really appreciate it
Best Regards,
Osman
Message was edited by:
        Osman Baig

Similar Messages

  • How do i able to get data for unit price using RSEG table?

    Dear All,
    How do i able to get data for unit price in RSEG table?

    Hi Thiru,
    Please check the logic in thread http://scn.sap.com/thread/1347964
    Hope this helps.
    Regards,
    Deepak Kori

  • Assign Month within a date range (by most days in a given month)

    I have a begin and end date, sample data as such
    select to_date('01-13-12','mm-dd-yy') from_dt,
    to_date('02-23-12','mm-dd-yy') to_dt
    from dual
    union all
    select to_date('03-15-2012','mm-dd-yy') from_dt,
    to_date('04-16-2012','mm-dd-yy') to_dt
    from dual
    union all
    select to_date('05-13-2012','mm-dd-yy') from_dt,
    to_date('07-23-2012','mm-dd-yy') to_dt
    from dual
    How do I assign a month by the most days in a month within that date range? Sometimes the date range might have the exact same amount of days in a month (like 3/15/2012 has 16 days and 4/16/2012 has 16 days). In this case, I want the earlier month (march).
    So from the sample data:
    01/13/2012, 02/23/2012, February
    03/15/2012, 04/16/2012, March
    05/13/2012, 07/23/2012, June
    Thanks
    Edited by: user4422426 on Mar 1, 2012 5:15 PM

    Hi,
    Here's one way:
    WITH     cntr          AS
         SELECT     LEVEL - 1     AS n
         FROM     (
                   SELECT      1 + MAX (to_dt - from_dt)     AS max_day_cnt
                   FROM     table_x
         CONNECT BY     LEVEL     <= max_day_cnt
    ,     got_r_num     AS
         SELECT     x.from_dt, x.to_dt
         ,     TRUNC (x.from_dt + c.n, 'MONTH')     AS month
         ,     count (*)                    AS cnt
         ,     ROW_NUMBER () OVER ( PARTITION BY  from_dt, to_dt
                             ORDER BY        COUNT (*)     DESC
                             ,             TRUNC (x.from_dt + c.n, 'MONTH')
                           )     AS r_num
         FROM       cntr     c
         JOIN       table_x  x  ON  c.n  <= x.to_dt - x.from_dt
         GROUP BY  x.from_dt, x.to_dt
         ,       TRUNC (x.from_dt + c.n, 'MONTH')
    SELECT     from_dt, to_dt
    ,     TO_CHAR (month, 'Mon YYYY')     AS mon
    ,     cnt
    FROM     got_r_num
    WHERE     r_num     = 1
    ;Thanks for posting code to create the same data. Please test your code before you post it: you got the order of arguments to TO_DATE reversed.

  • LIV - credit memo : error message shown for unit price variances

    hi
    In LIV for Credit Memo, there is no warning nor error message shown for unit price variances (price different from that in PO).  Request not allow to have unit price variances for Credit Memo. pls advice how can i do it
    thanks

    Hi,
    If you are posting a credit memo against a PO you cannot post it for MORE than the value of the PO, the system gives you the message that says something like, the value entered is higher than the PO value and so the PO value has been used.
    Is this giving you a particular problem?
    remember that youare generating the credit memo and so you can ask the vendor for whatever you want (although you may not actually get it). It is not like entering an invoice where the vendor is specifying the values.
    Steve B

  • SetBackColor for Unit Price !?

    I'm asking because I'm not sure what is wrong.
    See the 2 lines below, the 3 is the ItemCode and the 17 is the Unit Price
    The back color works for the ItemCode but not for the Unit Price.
    I don't know if it's me doing something wrong  ! 
    oMatrix.CommonSetting.SetCellBackColor(iDetailRow, 3, GetColor(Color.Orange));
    oMatrix.CommonSetting.SetCellBackColor(iDetailRow, 17, GetColor(Color.Orange));

    "3" isn't accepted by SetCellBackColor as it's a int colNum
    SAP gave me 20 for Unit Price and it works but it doesn't make sence and I don't know where they took 20 from SAP
    when I go in the Form Settings the order is 17 for UNIT PRICE
    They even gave me a code to find the column by the title and yet it works and it finds 20 for UNIT PRICE but
    how and where if you're a user and not a machine to now that 20 is UNIT PRICE ?
    VERY CONFUSING !

  • Moving average price  based on date range, site and article.

    Hi ABAPers,
    I am working on SKU wise sales report. Based on user input of date range ,site and article I fetch data from VBRP table i.e., (billing data from stores) . I have searched a lot to find MAP but dint get convincing solution.
    I tried to get data from MBEW-VERPR but that doesnot give MAP for a given date. I also tried with condition record table and KONP table but not helpful.
    I also got to know about s031 and LIS configuration I am not sure whether functional consultant should do the changes.
    Kindly help me in obtaining the MAP for particular bill date, article and site(store).
    Regards,
    Dep

    You can found the moving average price in MBEW (current) and MBEWH (history table)
    The first goods movement after the period closing program updates the period in MBEW and writes the data of the previous period to table MBEWH
    - If you actually need map on a daily (or less) basis, you will have to calculate it from MBEW, MBEWH, MSEG and BSIM (...)
    - You could also look for the actual cost in MSEG related to records of VBRP.
    Regards,
    Raymond

  • Report for open invoice value against GR done within a date range

    Dear experts ,
    I need a report  between date ranges for which there is a GR done , but invoice is pending .
    Where can i get this ? 
    Regards
    Anis

    hi,
    You can  check few default PO reports wid proper paramater in it
    or
    Can check table EKBE
    or
    Check PO history in the PO doc
    Or
    Check the ME80FN
    Regards
    Priyanka.P

  • Ms Project 2013 report for resource name, tasks less than 100% complete within a date range I can set each time

    I have seen I can create a report for a resource name with a specified date range, and one that can show me for a resource name any incomplete tasks, but I want to do the following and cant work out how to state it in the report constructor:
    resource name equals - {I want to set a given resource in here}
    % complete is less than 100%
    start - date range is between [today -7 days] and [today +7 days]
    Please can someone show me how this is possible, I know it will be and it is me that has been defeated!!

    workspacedesign,
    Oops, my bad. I missed the point that the Name field for assignment rows will be the task name and that's not what you want. There is also a glitch in the date range filter. So, here's how to fix that.
    First, in the Resource Usage view, copy the Name field to Text1. Now select the resource line and do a fill down for all assignments under that resource. Do that for each resource. This could be automated with VBA, but for now, a manual setup should work
    fine.
    Second, instead of testing for the Name field in the filter, test for the Text1 field.
    Third, change the Finish test to be "less than or equal to".
    Now when you apply that filter, enter beginning date of your range and then the ending date of your range followed by the resource name. You should get the data you want.
    Unfortunately formulas in custom fields are not as flexible in Project as they are in Excel. For example, in Project a formula can only operate on data for that row. Further, even if you use the formula Today() +7 for your filter criteria, the first time
    the filter is used, Project will hard code today's date into the filter. The normal way around both of these shortcomings is to use VBA.
    Hope this helps.
    John

  • GL account for Unit Price changes A/R Invoice

    Hi,
    I need to know where the GL accounts are determined for Item unit price changes. My problem is as below:
    I have a delivery created for 2 material items. After creating the delivery, we want to reduce the unit price from 2600 (default) to 2500 per unit. ( this is without going into the discount column) as we wnat to reflect the same in the deliver note printout.
    When this is copied to an A/R invoice and then and we try to add this, an error is generated saying "GL accout missing".
    Can any one help to tell me which account this is exactly and where this is entered. we are using SAP B1 2005 PL50.
    Thanks in Advance !

    Hi Nirushad.......
    Its in Administration> Setup> Financials> GL Account Determination> Inventory Tab--> Price Difference account.
    First check the Set GL Method of what
    For checking this go to Administration--> System Initialization > General Setting> Inventory Tab and Set GL Method
    If its Warehouse wise then go to warehouse where transaction is happening and put the Price Diff. Acct in accounting Tab
    If its ItemGroup wise then go to ItemGroup where transaction is happening and put the Price Diff. Acct in accounting Tab
    If its Item Level wise then go to Item Master Data where transaction is happening and put the Price Diff. Acct in Inventory Tab
    Regards,
    Rahul

  • Getting last-day-of-week dates within certain date range

    Hi all,
    I have the following Challenge:
    I want to know the dates of the last day of all the weeks within a certain range of dates.
    For instance if my range would be 01-jun-2002 - 31-jun-2002
    then the returned days should be (lastday of the week is sunday):
    . 02-jun-2002
    . 09-jun-2002
    . 16-jun-2002
    . 23-jun-2002
    . 30-jun-2002
    I want to accomplish this by only using sql (no pl/sql) in a ora 8.0.x rdbms
    How would I do this? (if it's possible)
    Tia,
    Martin

    Christian's solution returns
    01-JUN-02
    08-JUN-02
    15-JUN-02
    22-JUN-02
    on my system. The first day of the week is dependent on NLS settings.
    SELECT MAX(realdate)
    FROM (
    SELECT TO_CHAR(TO_DATE('31-may-2002','dd-mon-yyyy') + ROWNUM,'IW') weekno,
           TO_DATE('31-may-2002','dd-mon-yyyy') + ROWNUM realdate
    FROM all_objects
    WHERE rownum <= TO_DATE('30-Jun-2002','dd-mon-yyyy') - TO_DATE('01-Jun-2002','dd-mon-yyyy')
    GROUP BY weeknoThe IW format model give ISO standard week numbers and a week always starts on Monday.

  • Obtaining data within a date range in XL Reporter

    Dear All,
    I'm currently working on BS in XL reporter.
    I was trying to extracting data in a date range, setting PER( Code >= @MthFrom Or Code <= @MthTo ) in report default tab.
    However, the result is shown as all data as of current date. E.g. Selection criteria: >=200808, <=200809, the result is shown as from Begining to 200810.
    Please kindly advise.
    Thank you.
    Regards,
    Julie
    Edited by: Julie Wan on Oct 1, 2008 1:10 PM

    Dear Gordon,
    Thank you for your reply.
    However my case is different to your given link.
    In my case, there is a result coming out, but not within the correct range i selected. It shows all instead.
    I tried to set the period range in report default tab,  in column tab of a expanding column, and in cell tab of an individual cell, but none have worked. E.g. PER( Code >= @MthFrom or Code <= @MthTo )
    Regards,
    Julie

  • SapScript: How to change write format for Unit Price

    Hi Experts,
    I have created a sapscript form in English and Japan language.
    In the Japan form, the unit price and quantity are being display as 123,456.78.
    but in English form, the unit price and quantity are being displayed as 123.456,78.
    I am also using a custom program for my logic but when the English form is used, when i write netwr field in a character field,
    it is defaulted as 123.456,78 even inside the program. How can I changed this to 123,456.78?
    My user data default for value display is 123,456.78.
    The print program for the form is a standard program used for PO (ME2*N) printing.
    Thanks in advance!

    Hi Breakpoint,
    My user data default for value display is 123,456.78 already but when using English form it is not display as such.
    Need help.

  • Results for a period of time (date range)

    Hi,
    Could you please help me with the following:
    SELECT a.lot AS LotNumber, a.codeart AS ItemCode, sum(a.quantity), a.unit AS Unit, a.datetrace AS Dates FROM Production.pps_lotstraces a
    WHERE a.codeart LIKE '886%' OR a.codeart LIKE '997%') and (a.datetrace between to_date('20100105','YYYYMMDD') and sysdate)
    GROUP BY a.lot, a.codeart, a.unit, a.datetrace
    ORDER BY a.lot, a.datetrace
    The only issue I have with this query is that when it is run I get following message
    ORA-01861 - literal does not match format string. This is related to the fact that the date is stored as a string.
    The query should look at the dates from the beginning of the year up to today which is a system date.
    Could you please advise how this issue can be resolved?
    Thank you in advance for your help
    Regards

    user12866679 wrote:
    SELECT a.lot AS LotNumber, a.codeart AS ItemCode, sum(a.quantity), a.unit AS Unit, a.datetrace AS Dates FROM Production.pps_lotstraces a
    WHERE a.codeart LIKE '886%' OR a.codeart LIKE '997%') and (a.datetrace between to_date('20100105','YYYYMMDD') and sysdate)
    GROUP BY a.lot, a.codeart, a.unit, a.datetrace
    ORDER BY a.lot, a.datetrace
    SELECT a.lot AS LotNumber, a.codeart AS ItemCode, sum(a.quantity), a.unit AS Unit, a.datetrace AS Dates
      FROM Production.pps_lotstraces a
    WHERE a.codeart LIKE '886%' OR a.codeart LIKE '997%') and (a.datetrace between to_date('20100105','YYYYMMDD') and sysdate)
                                                        ^
                                                        |
                                                        |
                                                        you have closing parenthesis but you don't have an opening parenthesis
    GROUP BY a.lot, a.codeart, a.unit, a.datetrace
    ORDER BY a.lot, a.datetraceaside from the missing opening parenthesis what is the datatype for your column a.codeart and a.datatrace?

  • Sum amount within a date range

    I have 2 tables where I Need to sum up sales amount within a booking date range.
    Below an example to help illustrate this task.
    Table1:
    CustomerID BookingDate (YYYY-MM-DD)
    1 2014-04-29
    1 2014-07-30
    2 2014-03-31
    2 2014-06-30
    Table2:
    CustomerID SalesDate (YYYY-MM-DD) Amount
    1 2014-01-30 20
    1 2014-02-25 30
    1 2014-05-20 100
    1 2014-07-30 200
    1 2014-09-30 80
    2 2014-03-20 50
    Result:
    CustomerID BookingDate (YYYY-MM-DD) Sum(Amount From Table2)
    1 2014-04-29 50 -- SalesDate between 2014-01-01 and 2014-04-29
    1 2014-07-30 300 -- SalesDate between 2014-04-30 and 2014-07-30
    2 2014-03-31 50 -- SalesDate between 2014-01-01 and 2014-03-31
    2 2014-06-30 0 -- SalesDate between 2014-04-01 and 2014-06-30

    Please try this code:
    declare @Table1 table
    (CustomerID int,BookingDate date );
    insert @Table1
    values
    ( 1, '2014-04-29' ),
    (1, '2014-07-30' ),
    (2, '2014-03-31' ),
    (2, '2014-06-30') ;
    declare @Table2 table
    (CustomerID int, SalesDate date, Amount int);
    insert @Table2
    values
    (1,'2014-01-30',20) ,
    (1,'2014-02-25',30) ,
    (1,'2014-05-20',100) ,
    (1,'2014-07-30',200) ,
    (1,'2014-09-30',80) ,
    (2,'2014-03-20',50) ;
    with cte as
    select
    CustomerID,
    BookingDate ,
    row_number() over (partition by CustomerID order by BookingDate ) as rn
    from @Table1 )
    , cte2 as
    select
    T2.CustomerID ,
    isnull(T1.BookingDate, '2014-01-01') as FromDate,
    T2.BookingDate as ToDate
    from cte as T1
    right join cte as T2
    on T1.rn = T2.rn - 1
    and T1.CustomerID = T2.CustomerID
    select
    b.CustomerID ,
    b.ToDate as BookingDate,
    isnull(sum(a.Amount), 0) as [Sum(Amount From Table2)]
    from @Table2 as a
    right join cte2 as b
    on a.CustomerID = b.CustomerID
    and a.SalesDate > b.FromDate
    and a.SalesDate <= b.ToDate
    group by
    b.CustomerID ,
    b.ToDate;
    T-SQL Articles
    T-SQL e-book by TechNet Wiki Community
    T-SQL blog

  • Calculate number of times a name appears within a date range.

    Hello,
    I am actually using the iPad version but I assume the formula will be the same. Say I have a date in column A and a list of names in column B. What would the formula be to calculate the number of times a specific name appears in a date range.
    Thank you

    If C2 = the minimum date of the range
    C3= the maximum date of the range
    and you are looking for John as the name
    =COUNTIFS($A,">="&C2,$A,"<="&C3,B,"john")
    which counts cells where A>=the min date and A<=the max date and B="john"

Maybe you are looking for

  • 'Photo Library' vs. 'My iPhone photos'

    When I sync my pictures, it appears both in Photo Library and as the synced folder - is there any way to avoid this?

  • Control Document Posting for value range

    Hi All, I have requirment in which if a user tries to post a doument via T Codes ( FB01, FB50, FB60, FB70, FBV2 and a custom program which would use BAPI / BDC) and if the total amount of the document ie >999 $, the document should not get posted ins

  • HT1660 Is it possible to put a song in multiple playlists?

    Is it possible to put a song in multiple playlists?  Example can I put a song in both Canadian and in Rock playlists

  • Why does Mountain Lion triggers front fan in Mac Pro?

    Hi all, this is my first visit to this community and I hope there won't be much more . I bought a new SSD drive for my Mac Pro (early 2008). I had to install it from my Macbook Pro because Leopard in the Mac Pro wouldn't allow me to. Neither I could

  • DCOM time out

    Hi! Everytime I start Windows 8 I get The server {4545DEA0-2DFC-4906-A728-6D986BA399A9} did not register with DCOM within the required timeout. The server {4545DEA0-2DFC-4906-A728-6D986BA399A9} did not register with DCOM within the required timeout.