Moving Average in a Report Section

Hi there,
I am displaying a measure in a chart that has three data points. The measure is 4 day moving average of a metric. Let's say my query brings back the last 6 days, which enables me to calculate the 4 day moving average for days 4, 5, and 6.
I use the Previous() function to calculate the moving average:
=(metric + Previous(metric) + Previous(Previous(metric)) + Previous(Previous(Previous(metric)))) / 4
I don't want to show days 1, 2, and 3, so I filter these out of the chart and wrap a NoFilter() around the moving average. Everything is good so far.
The problem arises when I section on a dimension. I can't seem to get the correct values unless I display all 6 data points in each section. NoFilter() doesn't seem to work.
Has anyone run into this before? Does there exist a solution for this?
Any help would be greatly appreciated.
Thanks,
Allan

I figured it out:
NoFilter([[4wkMvAvgMeasure]]) ForEach ([[day]]) In Section
Thanks,
Allan

Similar Messages

  • Moving Average Price Tolerance Report

    Is there any standard SAP report that can display moving average price variances?  I want to be able to see the percent change in the moving average price after each time that it changes.
    The report S_P00_07000139 displays the old moving average price and the new one, but there is no field for variance.  I know that OMR6 sets the tolerance keys to company codes, but is there any record of the VP key tolerance violations?
    The goal is to be able to see all of the materials that have a moving average price that changed by more than 10% from its last price.
    Thanks

    Hello, Uuklyph,
    if you are not satisfied with  S_P00_07000139l, the easiest way would be to create a query (tx SQ01/02/03) over table MSEG "Document Segment: Material", with custom formula for MAP change, calculating with field LBKUM "Total valuated stock before the posting" and SALK3 "Value of total valuated stock before the posting".
    Kind Regards
    TomT

  • Report on Standard Prices & Moving Average Prices

    Hi,
    Would like to have a report on List of Materials with Standard Price & Moving Average Price per plant?
    Though we use Standard Price, since material master also gets updated with Moving average Price.
    Regards,
    Vengat

    Hi,
    Try MM60 tcode, see if it is suitable to you.
    It shows you both (average / standard price)
    Best Regards,
    Natan

  • Report for moving average price

    Hi guys
    Is there any report in MM which shows me different Moving average prices for a material (scenario is price changes very often for the material in PO)
    Thanks
    Samuel

    I do not think you will have such data stored in the system but you could pull the data for the current period, previous period and previous year from table MBEW. This much possible.

  • Show both Moving Average and Standard Price of an item in Report Composer

    Hello
    I do follow all my items at standard price. But i wish to get on the same report both the standard price and the moving average price.
    How can i do so :
    1 - either by a default report
    2 - Or by using report composer
    3 - By using a SQL Query
    Thanks
    Stéphane

    Thanks but is there a way to get both data on the same report ?
    The solution you gave me allows me only to output two different reports....I don't mind working with a vlookup from time to time but on a daily basis, this is a bit laborious
    Thanks for your continuous support
    Stéphane

  • SSRS 2008 Column Chart with Calculated Series (moving average) "formula error - there are not enough data points for the period" error

    I have a simple column chart grouping on 1 value on the category axis.  For simplicity's sake, we are plotting $ amounts grouping by Month on the category axis.  I right click on the data series and choose "Add calculated series...".  I choose moving average.  I want to move the average over at least 2 periods.
    When I run the report, I get the error "Formula error - there are not enough data points for the period".  The way the report is, I never have a guaranteed number of categories (there could be one or there could be 5).  When there is 2 or more, the chart renders fine, however, when there is only 1 value, instead of suppressing the moving average line, I get that error and the chart shows nothing.
    I don't think this is entirely acceptable for our end users.  At a minimum, I would think the moving average line would be suppressed instead of hiding the entire chart.  Does anyone know of any workarounds or do I have to enter another ms. connect bug/design consideration.
    Thank you,
    Dan

    I was having the same error while trying to plot a moving average across 7 days. The work around I found was rather simple.
    If you right click your report in the solution explorer and select "View Code" it will give you the underlying XML of the report. Find the entry for the value of your calculated series and enter a formula to dynamically create your periods.
    <ChartFormulaParameter Name="Period">
                      <Value>=IIf(Count(Fields!Calls.Value) >= 7 ,7, (Count(Fields!Calls.Value)))</Value>
    </ChartFormulaParameter>
    What I'm doing here is getting the row count of records returned in the chart. If the returned rows are greater than or equal to 7 (The amount of days I want the average) it will set the points to 7. If not, it will set the number to the amount of returned rows. So far this has worked great. I'm probably going to add more code to handle no records returned although in my case that shouldn't happen but, you never know.
    A side note:
    If you open the calculated series properties in the designer, you will notice the number of periods is set to "0". If you change this it will overwrite your custom formula in the XML.

  • Moving average price in case of goods receipt with free of charge

    Hello everyone,
    Need some inputs......
    Sometimes we receive materials from suppliers free of charge (e.g. warranty replacement) u2013 moving average goes down u2013 worst case 0,01 EUR/piece. This causes problems in government reporting and export documentation EX1 and clearance/pro-forma invoice) for deliveries to field engineers (Order type ZIS1, ZIS3 u2013 item cat. ZICA), because moving average price is used for the values in government reporting and on the invoices. In government reporting and on invoices we need to state a true value of the part.On the other hand, the value warehouse stock is depending on the moving average cost as well.Could you please let me know, how to handle such receipts from the supplier to have a correct stock value and correct values on invoices and government reporting?
    Thanks
    Deepthi...

    Hello Deepthi,
    It depends on your company policy. If you want to valuate the material along with the material purchased handled in moving average price, free consignment will bring down the MAP for the material.
    In that case, you can revaluate the material to the original price in MR21 transaction.
    If you are not going to handle the materials received free of charge along with the purchased material, you can go with another material code, with non valuated material type.
    But i guess, no company will be asking for another material code. So go for revaluation after the receipt of free consignment.
    Regards

  • Moving Average Price for Sales stock and Project stock of a material

    Hiya Gurus,
                     I am developing a report to display inventory details. My requirement is that I have to display the Moving average price of a material for all Valuation type. I also need to display the Moving average price if a material has got Project stock or Sales stock.
                     In MBEW table I can get the Valuation type and its Moving average price, but how can I find the moving average price for the same material if it has got Sales stock and project stock. Please let me know the table and field where I could get the relevant data.
                    Kindly help me on this, it would be deeply appreciated.
    Cheers,
    ZIa

    Hi
    can you look at tables
    EBEW                             Sales Order Stock Valuation
    QBEW                             Project Stock Valuation
    Nat

  • SSRS 2008 R2 - Add moving average to column group

    I have a column group of dollar amounts.  The row is a year/month.  I would like to add a moving average column to the right of the last 6 months.  My SQL Server data source is already complex enough and I'd really prefer not to add a column
    there.  Is there anything I can do within the report itself?  Some way to reference the previous records in a matrix?
    Thank you!

    Hi mateoc15,
    According to your description, you have a matrix in your report. Now you want to calculate the average value of last 6 month. Right?
    In Reporting Service, we can put custom code into report to deal with complicated logic. Add one more column/row inside of group and call the functions defined in custom code. For your requirement we modified Robert’s code to achieve your goal. We tested
    your case in our local environment with sample data. Here are steps and screenshots for your reference:
    Put the custom code into report:
    Private queueLength As Integer = 6
    Private queueSum As Double = 0
    Private queueFull As Boolean = False
    Private idChange As String=""
    Dim queue As New System.Collections.Generic.Queue(Of Integer)
    Public Function CumulativeQueue(ByVal currentValue As Integer,id As String) As Object
    Dim removedValue As Double = 0
    If idChange <> id then
            ClearQueue()
                    idChange = id
                    queueSum = 0
                    queueFull = False
                    CumulativeQueue(currentValue,id)
    Else
                    If queue.Count >= queueLength Then
                                    removedValue = queue.Dequeue()
                    End If
                    queueSum += currentValue
                    queueSum -= removedValue
                    queue.Enqueue(currentValue)
                    If queue.Count < queueLength Then
                    Return Nothing
                    ElseIf queue.Count = queueLength And queueFull = False Then
                    queueFull = True
                    Return queueSum / queueLength
                    Else
                    Return (queueSum) / queueLength
                    End If
    End If
    End Function
    public function ClearQueue()
    Dim i as Integer
    Dim n as Integer = Queue.Count-1
    for i=n To 0 Step-1
                    queue.Dequeue()
    next i
    End function
    Add one more row inside of group, call the function defined in custom code.
    Save and preview. It looks like below:
    Reference:
    Moving or rolling average, how to?
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou (Pactera)

  • Using Moving Average Materials with MF42N (Repetitive Production)

    Version: ECC 6.0
    I have a "Is this possible" question.  I know this isn't a best business practice, but thought I'd anyway.  Here goes ...
    A material that uses Moving Average (referenced as Material123 below) has the following two materials in its BOM:  (1) Moving Average (Material456), and (2) Non-valuated material, material type = LEER (Material789).
    The 1st material in the BOM (Material456) is Liquid Oxygen.  This product is purchased from a vendor and received into inventory via movement type 101.
    The 2nd material in the BOM is an empty cylinder (Material789)
    The parent material (Material123) being produced is gaseous Oxygen (Oxygen in gas form).
    Basic production process:  Liquid Oxygen is the raw material, it is pressurized and stored in a cylinder in gaseous form (for clarity, you've probably seen cylinders before, the two obvious examples of cylinders are propane cylinders used on barbeques and helium cylinders used to blow-up balloons).
    Assumptions:  (1) We do not want to do a cost roll, (2) We want to report production (TCode=MF42N) to consume the Bulk Oxygen (Material456) and the cylinder (Material789), and create the finished good (Material123), and (3) We do not want to burden the cost of the parent material (Material123) with direct costs, we only want the material costs.
    If you read through the assumptions you can see that this is not proper accounting for a production process (i.e. the direct costs in the production process are not capitalized -- labor, power, etc.), if you can get beyond that I was wondering if anyone has ever set anything like this up?  I tried to set this up and report production in my test environment, I got the materials created, the BOM created, but when I tried to report production it gave me an error, it needs a production version and/or a cost collector.
    If anyone has done anything like this I'd be interested in knowing if it is possible to report production with a setup like this.  Thanks.

    Using CO production orders may solve your problem. They dont need PP or product costing to be implemented. Costs can be flexibly posted and there are not many demanding requirements for this.
    Tcode:KKF1
    Link: [http://help.sap.com/saphelp_erp2004/helpdata/EN/82/e72326b11411d29f60080009b0db33/frameset.htm]
    Thanks
    Naveen

  • Moving average price not updatet when sales order stock

    Sales order stock is ioncluded in calculating moving average (at goods receipt there is no new valuation type created)
    It is okay with replenishment orders (regular stock)
    I first thought it had to do with Spec. Stk Valuation indictator (but this one is set to 'M', which seems right for me.
    Does anyone have a clue what I can do so my moving average value is also calculated based on sales order stock and not only regular stock?
    Kind Regards
    Kevin
    Edited by: Kevin Gielen on May 5, 2010 2:44 PM

    Spl Stock Valution must be - A (not M) to valuate along with normal stock .
    Ensure following configuration is there
    1. create Requirement class in OVZG . Maintain required account assignment category under account assginment subscreen
    2. Create requirement type in OVZH . assign this req.class to req.type
    3.Assign requirement type to sales item categories for which you need this VSO functionality
    4.Goto SM30 and give table V_T459K_K ,mainatain ,for your requirement class under valuation field maintain M or A(put F1 for moreinfo)
    5.Take SD consultant help to setup schedule line category(SC) for this item category ,it should have account assignemtnt category and PR order type - VOV6 and assign this SC to item category in VOV5
    6. Now create SO which will populate the above created item category (if not check with SD consul to populate the above item category)
    7.convert the PR generated through above SO into PO
    8.In PO under account assignment tab you could see BSX account and it must be greyout .
    9.Do GR ,stock will be updated in MBBS report.
    it resolves your requirements
    check point in each transaction:
    after SO ,check VBAP- KZBWS = M or A (which you have maintained in requirement class)
    PR from SO, EBAN-KZBWS =M or A and PO also will have EKPO-KZBWS = M or A

  • Moving Average Price for Non-Valuated Material

    Hello Experts
    The question may seem to be quirky but need your advice for the below.
    My client is buying non-valuated material against a cost center, they do not want to keep the stocks valuated. No value update only quantity update. The accounting documents are the following when the GR is done by receiving folks
    Qty of material XYZ goods receipted = 10
    Debit     Consumption GL   12345678       10 USD          Cost Center ABC123 (This is a warehouse cost center)
    Credit    GR/IR account                            10 USD
    Qty of mateiral XYZ issued = 5
    The goods are later on issued to Production cost center and the client was the below entries to be passed with MOVING AVERAGE PRICE.
    Debit    Consumption GL 12345678           6 USD          Cost Center ABC456 (This is production Cost center)
    Credit   Consumption GL 12345678           6 USD          Cost Center ABC123 (This is warehouse cost center)
    I am aware that as this is a non valuated material the above entry is not possible. Maybe, I will use BAPI_ACC_DOCUMENT_POST for the generating the accounting document when the goods are issued from warehosue to production center.
    My question is how can i get the moving average price.
    Regards
    Chokkalingam Pillai

    you can have an accounting view for non-valuated materials, this helps for example with purchase requisitions as they could take the valuation price from the material master and the user does not need to enter a valuation manually.
    But the material master moving average  price cannot be calculated and updated automatically, as it is not foreseen in any standard program to do this for cost center procurement, since SAP only calculates a MAP for valuated stocks.
    Further it is not logical to issue non-valuated stock valuated (even with a different price) from cost center to cost center.
    It looks like you want to  have a kind of internal billing for warehouse services, as you end up with a negative amount in the warehouse cost center which is then the profit.
    Why don't you just  create a report to run at the end of the month, listing all goods issue movements with their cost centers and taking the price from last PO (or from material master if you decide to maintain it manually) and use this for a manual cost center posting in CO module

  • Moving average price in case of project stock

    Hi,
    How to check the moving average price of a material in case of project stock?
    T code or table will help..
    Regards,

    Hi,
    Since project stock is a special stock, it is procured and cosumed against that particular project / WBS Element, you will not get value of it as a movong average price , may be you will get the same in project progress report. You can check report MBBS - Valuated Project Stock
    Regards,
    Vikas

  • PROBLEM WITH MOVING AVERAGE PRICE

    Hi,
    Correct me if I’m wrong, but from what I know the moving average price should only change or be recalculated when purchases or goods_recipts are made, otherwise items should be consumed at a FIXED moving average price (cost). 
    I´ve noticed when looking into the Inventory Audit Report that the moving average price is changing in my installations and I see that SAP BO recalculates it every time an issue is made. This last thing only happens when the total amount of the transaction is rounded or left with 0 decimals and the other types such as prices, rates, quantities, percent, etc. are left with 2 or 3 decimals.
    Because of my country settings, the total amount has to have 0 decimals (I live in Chile and we don’t have cents in our currency) and the moving average price of an Item should not change when an issue is made, can you help me with this?
    Thanks and best regards to you all.
    Fernando

    Hi Nagesh,
    Thank you for your quick response.
    I understand what you say, but moving average price should not change when an issue is made and that´s what is bothering us.
    The difference between what it shoud be and what SAP BO is calculating is our concern, ie: let´s say the number of transactions is 100, would that difference be negligible?
    Here is an example:
    Goods issue:
    SO 8     11     -10,49     166,67     -1.748     99,35     16.559
    SO 9     11     -10,49     166,673     -1.748     88,86     14.811
    SO 10     11     -10,49     166,678     -1.748     78,37     13.063
    SO 11     11     -10,48     166,684     -1.747     67,89     11.316
    SO 12     11     -10,56     166,681     -1.760     57,33     9.556
    Note that coma (,) is decimal separation and period (.) is the mile separator.
    Where the 3rd line is the quantity of the goods issue, the 4th is the moving average, and the 5th is the total quantity of the issue.
    So you see 10,49 x 1748 = 1748,39977= 1748(SAP) and then SAP BO recalculates the AVG. Price.
    The problem I was talking about was the difference of the stock AVG Price with one hundred transactions or so... now the difference seems negligible (166,7 - 166,681 = 0,011).
    Can you see it changes?, is that a bug?
    Thank you
    Fernando

  • Performing math on Decode function tags and moving averages

    I have a query shown below to create columns for my report. Can I use the field names as shown in bold to perform math functions? Is there an easy way to do this?
    select Data_date,
    SUM(DECODE(tag_id,'SEF_F0348I',avg_value,NULL))"TE_Flow_mgd",
    SUM(DECODE(tag_id,'L_STEbod_con',avg_value,NULL))"TE_BOD_mgl",
    "TE_FLOW_mgd" * "TE_BOD_mgl" * 8.34*.45359 as "KG_BOD"FROM daily_tag_data
    Where data_date >= to_date('12/31/2002','mm/dd/yyyy')
    GROUP BY data_date;
    Also how would I perform a seven day moving average on "KG_BOD"
    Thanks - Very new at this.

    If you want avoid a sub-query, try this...
    select Data_date,
    SUM(DECODE(tag_id,'SEF_F0348I',avg_value,NULL))"TE_Flow_mgd",
    SUM(DECODE(tag_id,'L_STEbod_con',avg_value,NULL))"TE_BOD_mgl",
    SUM(DECODE(tag_id,'SEF_F0348I',avg_value,NULL)) * SUM(DECODE(tag_id,'L_STEbod_con',avg_value,NULL)) * 8.34*.45359 "KG_BOD"
    FROM daily_tag_data
    Where data_date >= to_date('12/31/2002','mm/dd/yyyy')
    GROUP BY data_date;
    just replace the 'column-alias' with the actual arithmetic fuction...

Maybe you are looking for

  • How to use credit on my itunes account?

    I show $26.09 credit on my account but when I try to purchase, it never deducts from this amount, it wants me to use credit card of gift/itune card? How do I use this credit to purchase?

  • How do i fix an ipod touch 2gen continually rebooting.

    Hi i have an repair business that i am running for many items like cracked screens. I got this ipod from a friend to fix two things, one a cracked screen,second to replace battery. The problem he told me that it continueslly reboots when in a chargin

  • I have a new iPhone 5S, how can I get my photostream photos from my previous phone(iPhone 4S) to my new one.

    I have a new iPhone 5S, how can I get my photostream photos from my previous phone(iPhone 4S) to my new one.

  • Page download

    Hi, Is it possible to make a page only appear once the entire page has downloaded. I don't like the page gradually appearing as each image etc. is downloaded, and would prefer the page to stay blank until the entire page is ready. Any advice would be

  • Won't start after update.

    After the last update, Aperture thinks I have a new program and keeps asking for the serial number. I've had the program for years, upgraded 2 to 3 with the disc upgrade, but I can't find the original disc or packaging, as I've moved twice since then