Calculating average for periods between years

Hello,
I'm stuck with creating calc script to calculate period average. There are 12 periods (P1 to P12) and Years. For certain account member (AV Balance) I need to calculate the average of another account member (Balance) for current period and the previous one, so if account "Balance" is 100 for P1 and 200 for P2, account "AV Balance" for period P2 should be 150. That's easy. The problem is that if I need to calculate the average for period P1, the calculation must take P1 for current year and P12 for previous year, can you advice me on how to create the calc script?
What I have at the moment (I'm very new in calc scripts) is for each period (except P1 as it has to use P12 from prior year):
FIX (P2)
"AV Balance"=@SUMRANGE ("Balance","P1":"P2")/2;
ENDFIX
FIX (P12)
"AV Balance"=@SUMRANGE ("Balance","P11":"P12")/2;
ENDFIX
Kind regards
Marcin Stawny

My first question is are your periods in a dense dimension if so, your calculation will calculate every single block in the database. This might be better if .
you did it as a formula using currmbrrange
something like
IF(@ISMbr("Jan"))
Balance + @shift(Balance,-1,years);
else
@avgrange(skipmissing,Balance,@CURRMBRRANGE(Period, LEV, 0,-1,0));
endif
Note, I have not syntax checked this and I'm really bad at getting the correct number of parens, also you might want to put a second if statement wrapping this to only do it at level zero of periods. I would make this member dynamic and you might need to make it two pass

Similar Messages

  • Health app: bug in daily average for sleep in year view?

    I've manually entered sleep time for everyday since August 2014 in the Health app (on iOS 8, on an iPhone 6).
    In Day, Week, and Month view, the daily average seems correct (resp. 7h49, 7h09, 7h09).
    But it is obviously wrong in the Year view (12h36mn).
    Also the graph in the Year view is wrong. (The bar for August is twice as high as the one for October for instance.)
    (I've check -3 times- that these manually entered data were correct.)
    Does anybody experience the same problem?
    Or as any idea what the bars, in the Year Graph, are supposed to represent? (daily average for each month? or total sum of sleep time for the month?)
    Thanks in advance!
    Antoine

    The Health App really serves as a conduit between a variety of other apps that wouldn't ordinarily be able to talk to each other. The App Store has a section for apps that work with Health to be able to sync data.
    You can submit feedback to Apple here:
    http://www.apple.com/feedback
    Don't stress to much if you can't find a section dedicated to Health. Pick something under "iPhone" and just make sure you explain it well.

  • New posting period for former fiscal year

    Hello All!
    For a customer we set up a database with posting periods for 2011 and 2012 (monthly periods). The database went live in 2011.
    Now the requirement came up to post the opening balances for 2011 per end of 2010 (to have the postings not in fiscal year 2011).
    My question is: is it a problem to add now a fiscal year 2010 (yearly basis)?
    Thanks and regards
    Peter Ganserer

    Hi Peter,
    Although it is your 2nd posting, I would add welcome message because I had not do so 1st time.
    For your question, it is not possible to add new posting period for former fiscal year. You best solution is to post those OB as the first date of the first period.
    Thanks,
    Gordon

  • Asset Scrapping - Calculating Depreciation for entire year

    Hi guys
    We want to scrap an asset without revenue using ABAVN.
    Asset Details:
    The asset will be completely depreciated by the end of this year (December)
    We have smoothing indicator on.
    We wish to post the retirement and close out the asset balances in this month itself.
    (No depreciation should be pending for the remaining periods of the year)
    When we post the retirement transaction in test environment, it still shows the planned depreciation for the entire year.
    How do we avoid the planned depreciation posting for future periods ?
    Thanks!
    Gautam

    Perhaps, the following might be a solution that can be implemented safely in a production setup:
    Objective: To post retirement related depreciation in a single period without smoothing over the remaining periods.
    Solution:
    Perform standard depreciation posting run for current period
    Turn Smoothing Indicator Off
    Write Off Asset
    Run Repeat Depreciation Posting Run (select Repeat Posting Run instead of planned and also input the retired asset number)
    Turn Smoothing Indicator back on
    This should post the complete depreciation in the current period for the retired asset and smooth out the depreciation for all remaining assets

  • Report for internal order - year/period comparison

    I want to create a report for internal orders with year/period (from/to) comparison.
    For the present year/period i'm using CCA variables  1YRPERF (Fiscal Year/Period From) and 1YRPERT (Fiscal Year/Period To), created from field FISCPER, table RWCOOM.
    Now i want to creat a column fot the n-1 period (example: if selected current period as 009.2013 to 008.2014 the n-1 period will be 009.2012 to 008.2013), any suggestion what can I do about this?
    Regards
    Carlos Aguiar

    Hi Ajay
    This is for higher education institution that have to report by fiscal year (01-12 months) and by academic year (09.year1 to 08.year2). I have two maps to do this but the challenge is to have a unique map that by dates could retreive both information.
    I need a to have a column giving the total for example the Per/Yr 009.2012 to 008.2013 and other column with the Per/Yr -1.
    I've tried your first option but doesen't work at all because don't work with a period like 009.2013 to 008.2014. Then i made some adjustments: first column was setted to Yr (variable: 6-GJAHV to 6-GJAHB) and Per (variables: 1NPERIV to 1NPERIB). The second column was setted with Yr (variable: 6-GJAH2 to 6-GJAH2) and Per (variables: 1NPERIV to 1NPERIB). Seems to work with a few tests!
    Also i tried to creat new variables "1YRPERF" / "1YRPERT" to n-1, but had some problems with formula.
    1YRPERF have a formula: '#S012-999' and 1YRPERT formula is: '#S012'.
    To 1YRPERF-1 i've defined the formula '1YRPERF' -1, and for the Per to the formula '1YRPERT' -1, but seems to consider minus 1 period that the entry period. I've tried with -12 but didn't work too.
    Thatk's for the help!
    Regards, Carlos

  • I have had apple products now for apron 7 years BUT have never been able to make the bluetooth work , not even when 2 products i.e. : phone and iPod are in the same room. So i stopped trying but would like to set it up between my iMac and i

    hi can anyone help please ? i have had apple products now for apron 7 years BUT have never been able to make the bluetooth work , not even when 2 products i.e. : phone and iPod are in the same room. So i stopped trying but would like to set it up between my iMac and iphone / ipad but can't get it to work, they say discoverable but just will not connect to one another. I also tried the connection code and tried without one ... NO JOY ... Is this common or am i a twit ?

    You can't connect an iPhone or iPad to a Mac via Bluetooth, except for Internet tethering.
    You're not doing anything wrong - it just isn't a feature of iOS devices.
    What were you hoping a Bluetooth connection would allow you to do?

  • ESS Benefits error - No entry for period parameter 04/payroll year/payroll

    Hi,
    When I click on Annual Enrollment link under ESS Benefits section, I get an Error from Standard WebDynro Application - No entry for period parameter 04/payroll year/payroll period. What config could be missing in the R/3 ?
    Any suggestions?
    Cheers,
    Murali.

    Hi,
    Employee assigned Payroll area (refere to  IT0001- Org Assignment) not moved into prd Payperiods. And as per you Payroll area assigned to "00", Ask your payroll consultant assign payroll area period parameters and generate periods through T.code "OG00"
    Issue is with T549Q..

  • Average in Results row in calculation properties for Bex Key figure does not work in Analysis for Office 1.4.7

    We are moving from Bex 3.5 to Bex 7.0 and using Analysis for Office 1.4.7
    We have queries that do an average for the results rows of dynamic calculations and the queries will not open in Analysis for Office 1.4.7 (example is below)
    We get an error message that can be found below
    We were able to open the queries in Analysis 1.4.5 with the correct results.
    We do not understand why it worked in an older version and not the new one.
    Is there something missing in the version 1.4.7 of Analysis for Office that is preventing our queries from running?
    We do not want to move back to 1.4.5 because the performance is better in 1.4.7.
    Help.....

    Hi Patty,
    I just checked 1.4.7 by making "Calculate Results As.." for Key figure and formula to Average(and also tried others as well). No error is coming in Analysis Office. reason might be because of other reason
    Any way, As Tammy Powlas suggested can you check with SP8

  • Calculation average only in summer period

    Dear all,
    I am trying to make a report with a summeraverage. This means that I want te report to calculate an average if the date falls between 1 april and 30 septembre. What I used was the formula:
    =if (<date> Between ('1-4-2009' ,'30-9-2009')) then (average(<value>))
    It seems ok, but I am getting an error. Can someone tell me how to make it work?

    Hi,
    The formula should be:
    =Average((If <date> Between ('4/1/2009' ,  '9/30/2009') Then <value>))
    Regards,
    Harry

  • Frequent internet disconnects for over a year

    I have been suffering frequent disconnects from the internet for over a year. Each disconnect lasts for up to two minutes, rarely longer. Sometimes the disconnects have been as frequent as thirty or more times per hour. Sometimes I have no problems for many days.
    I'm using HH5 and have Infinity 2 with a typical speed of circa 60mbps. Speed isn't an issue but the frequent disconnects are a pain. BT Broadband support have been unable to see the disconnects happening. As far as they are concerned, the line is fine.
    If the disconnect happens when I'm using Google Chrome, I get a status message "Resolving Host" in the bottom left and, after a short delay, a screen appears saying "This webpage is not available. DNS Probe Finished. No Internet." Other devices, including BTTV, either give a message to the effect that there is no internet connection or just "hang". As far as I can tell, all devices, whether wired or wireless, 2.4GHz or 5GHz,, disconnect simultaneously.
    I have tried disconnecting every device from the hub except the BTTV and the disconnects still happen.
    BT have checked the line countless times, sent an engineer to my house, replaced my home hub three times, I have replaced all cables, replaced the phone/broadband socket, done countless resets etc all to no avail. The HH5 lights don't change colour when the internet connection drops.
    After checking the BTCare Community Forums and discovering the event log in the HH5 I discovered that, when the disconnects occur, an "IN: BLOCK [16]..." message appears in the event log for the Firewall of the hub. At the end of this message I have copied a 12 hour firewall event log from today. Every "IN: BLOCK [16]..." event seems to coincide with an internet disconnect so that amounts to circa 40 disconnects in the past 12 hours.
    What are these "IN: BLOCK [16]..." messages and why does my internet connection drop every time one of these messages appears? I checked the IP addresses for some of these "IN: BLOCK [16]..." messages. The first IP address in each message I checked was in China. The second IP address for each event I checked is BT in Boston, UK. My suspicion is that the BT server is logging me out every time one of these "IN: BLOCK [16]" events occurs. Logging back into the server then takes up to two minutes and, in the meantime, I have no internet connection.
    BT Broadband support in India say that there is nothing they can do to address these internet dropout issues. They can only deal with line or hub faults. Their only suggestion was to disable the firewall on my HH5 but, given all these potential attacks from Chinese IP addresses, I refused to do this.
    BTW, the HH5 IP address ending in 65 is my BTTV box.
    I'd be grateful for any help and advice to resolve this issue. Here is the Firewall event log;
    20:44:07, 18 May. IN: BLOCK [16] Remote administration (TCP [43.255.188.131]:46973->[86.182.86.9]:22 on ppp3)
    20:35:11, 18 May. IN: BLOCK [16] Remote administration (TCP [119.82.226.82]:50172->[86.182.86.9]:443 on ppp3)
    20:05:44, 18 May. IN: BLOCK [16] Remote administration (TCP [37.247.36.123]:12152->[86.182.86.9]:443 on ppp3)
    19:27:54, 18 May. IN: BLOCK [16] Remote administration (TCP [115.239.248.2]:6000->[86.182.86.9]:8080 on ppp3)
    19:07:56, 18 May. IN: BLOCK [16] Remote administration (TCP [121.88.5.177]:8888->[86.182.86.9]:22 on ppp3)
    19:01:12, 18 May. IN: BLOCK [16] Remote administration (TCP [80.82.78.186]:39434->[86.182.86.9]:80 on ppp3)
    18:51:30, 18 May. IN: BLOCK [16] Remote administration (TCP [43.255.188.133]:45824->[86.182.86.9]:22 on ppp3)
    18:41:46, 18 May. IN: BLOCK [16] Remote administration (TCP [183.136.216.3]:9090->[86.182.86.9]:22 on ppp3)
    18:40:30, 18 May. IN: BLOCK [16] Remote administration (TCP [117.21.225.3]:10708->[86.182.86.9]:22 on ppp3)
    18:27:50, 18 May. BLOCKED 1 more packets (because of Remote administration)
    18:27:50, 18 May. IN: BLOCK [16] Remote administration (TCP [37.247.49.253]:35420->[86.182.86.9]:80 on ppp3)
    18:22:25, 18 May. OUT: BLOCK [7] ICMP replay (ICMP type 3 code 1 86.182.86.9->216.58.208.46 on ppp3)
    18:22:22, 18 May. BLOCKED 2 more packets (because of ICMP replay)
    18:22:22, 18 May. OUT: BLOCK [7] ICMP replay (ICMP type 3 code 1 86.182.86.9->216.58.208.46 on ppp3)
    18:09:52, 18 May. IN: BLOCK [16] Remote administration (TCP [39.115.40.60]:44439->[86.182.86.9]:80 on ppp3)
    17:31:58, 18 May. IN: BLOCK [16] Remote administration (TCP [61.240.144.65]:60000->[86.182.86.9]:161 on ppp3)
    17:30:18, 18 May. IN: BLOCK [16] Remote administration (TCP [198.20.69.74]:20012->[86.182.86.9]:443 on ppp3)
    17:25:05, 18 May. IN: BLOCK [16] Remote administration (TCP [185.35.62.13]:60643->[86.182.86.9]:80 on ppp3)
    17:22:10, 18 May. IN: BLOCK [16] Remote administration (TCP [61.160.224.129]:56517->[86.182.86.9]:8080 on ppp3)
    17:00:08, 18 May. IN: BLOCK [16] Remote administration (TCP [43.255.188.131]:50338->[86.182.86.9]:22 on ppp3)
    16:49:05, 18 May. OUT: BLOCK [7] ICMP replay (ICMP type 3 code 1 86.182.86.9->216.58.208.36 on ppp3)
    16:49:03, 18 May. BLOCKED 3 more packets (because of ICMP replay)
    16:49:02, 18 May. OUT: BLOCK [7] ICMP replay (ICMP type 3 code 1 86.182.86.9->216.58.208.36 on ppp3)
    16:37:49, 18 May. IN: BLOCK [16] Remote administration (TCP [218.77.79.43]:43469->[86.182.86.9]:22 on ppp3)
    15:54:37, 18 May. IN: BLOCK [16] Remote administration (TCP [71.6.216.62]:443->[86.182.86.9]:443 on ppp3)
    15:43:28, 18 May. IN: BLOCK [16] Remote administration (TCP [221.235.189.245]:38235->[86.182.86.9]:22 on ppp3)
    15:31:23, 18 May. IN: BLOCK [16] Remote administration (TCP [183.136.216.4]:9090->[86.182.86.9]:22 on ppp3)
    14:39:50, 18 May. IN: BLOCK [16] Remote administration (TCP [43.255.188.133]:49483->[86.182.86.9]:22 on ppp3)
    14:37:40, 18 May. OUT: BLOCK [7] ICMP replay (ICMP type 3 code 1 86.182.86.9->216.58.208.74 on ppp3)
    14:37:36, 18 May. BLOCKED 2 more packets (because of ICMP replay)
    14:37:36, 18 May. OUT: BLOCK [7] ICMP replay (ICMP type 3 code 1 86.182.86.9->216.58.208.74 on ppp3)
    14:03:46, 18 May. IN: BLOCK [16] Remote administration (TCP [183.136.216.3]:9090->[86.182.86.9]:22 on ppp3)
    14:00:11, 18 May. IN: BLOCK [16] Remote administration (TCP [82.102.180.11]:10469->[86.182.86.9]:22 on ppp3)
    13:57:17, 18 May. IN: BLOCK [16] Remote administration (TCP [82.221.47.5]:48212->[86.182.86.9]:22 on ppp3)
    13:49:16, 18 May. IN: BLOCK [16] Remote administration (TCP [43.255.188.135]:59887->[86.182.86.9]:22 on ppp3)
    13:43:33, 18 May. IN: BLOCK [16] Remote administration (ICMP type 8 code 0 198.20.99.130->86.182.86.9 on ppp3)
    13:08:25, 18 May. IN: ACCEPT [57] Connection closed (Port Forwarding: TCP [192.168.1.65]:7457 <--> [86.182.86.9]:1024 - - - [91.235.132.236]:443 SYN_SENT/SYN_RECV ppp3 NAPT)
    13:08:25, 18 May. IN: ACCEPT [54] Connection opened (Port Forwarding: TCP [192.168.1.65]:7457 <--> [86.182.86.9]:1024 - - - [91.235.132.236]:443 SYN_SENT/SYN_RECV ppp3 NAPT)
    13:02:30, 18 May. IN: BLOCK [16] Remote administration (TCP [221.235.189.245]:58370->[86.182.86.9]:22 on ppp3)
    12:55:09, 18 May. IN: BLOCK [16] Remote administration (ICMP type 8 code 0 178.124.19.8->86.182.86.9 on ppp3)
    12:07:45, 18 May. IN: BLOCK [16] Remote administration (TCP [104.233.142.242]:6000->[86.182.86.9]:8080 on ppp3)
    11:58:49, 18 May. IN: BLOCK [16] Remote administration (TCP [43.255.188.131]:54076->[86.182.86.9]:22 on ppp3)
    11:26:03, 18 May. OUT: BLOCK [7] ICMP replay (ICMP type 3 code 1 86.182.86.9->31.55.184.239 on ppp3)
    11:23:14, 18 May. IN: BLOCK [16] Remote administration (TCP [43.255.188.132]:37275->[86.182.86.9]:22 on ppp3)
    11:07:40, 18 May. BLOCKED 3 more packets (because of ICMP replay)
    11:07:40, 18 May. OUT: BLOCK [7] ICMP replay (ICMP type 3 code 1 86.182.86.9->216.58.208.46 on ppp3)
    10:39:08, 18 May. IN: ACCEPT [57] Connection closed (Port Forwarding: TCP [192.168.1.65]:7457 <--> [86.182.86.9]:1024 - - - [23.62.53.9]:443 SYN_SENT/SYN_RECV ppp3 NAPT)
    10:39:08, 18 May. IN: ACCEPT [54] Connection opened (Port Forwarding: TCP [192.168.1.65]:7457 <--> [86.182.86.9]:1024 - - - [23.62.53.9]:443 SYN_SENT/SYN_RECV ppp3 NAPT)
    10:17:56, 18 May. IN: BLOCK [16] Remote administration (TCP [43.255.188.132]:54983->[86.182.86.9]:22 on ppp3)
    09:29:53, 18 May. IN: BLOCK [16] Remote administration (TCP [61.240.144.64]:60000->[86.182.86.9]:443 on ppp3)
    09:25:48, 18 May. IN: BLOCK [16] Remote administration (TCP [183.136.216.3]:9090->[86.182.86.9]:22 on ppp3)
    09:25:21, 18 May. IN: BLOCK [16] Remote administration (TCP [196.12.153.45]:42739->[86.182.86.9]:22 on ppp3)
    09:25:15, 18 May. IN: BLOCK [16] Remote administration (TCP [43.255.188.130]:36950->[86.182.86.9]:22 on ppp3)
    08:58:58, 18 May. IN: BLOCK [16] Remote administration (TCP [222.186.56.178]:28384->[86.182.86.9]:22 on ppp3)
    08:37:28, 18 May. IN: BLOCK [16] Remote administration (TCP [118.244.130.34]:6000->[86.182.86.9]:22 on ppp3)
    08:17:59, 18 May. IN: BLOCK [16] Remote administration (TCP [222.186.31.208]:6000->[86.182.86.9]:22 on ppp3)
    08:12:22, 18 May. IN: BLOCK [16] Remote administration (TCP [141.212.122.151]:45461->[86.182.86.9]:22 on ppp3)
    08:02:56, 18 May. IN: BLOCK [16] Remote administration (TCP [218.77.79.43]:35046->[86.182.86.9]:8080 on ppp3)

    Ectophile - thank you for your reply. I tried the quiet line test and the line sounds good. There's no crackle or static. Just a very faint hiss if I turn the volume on my handset up full.
    I've had three replacement hubs in the last year or so and they have made no difference to the frequency of the internet drop-outs.
    The only fault that has been detected in all of this time was back in January when BTTV 2nd line support in the UK establish a link with my PC and monitored the connection. (They had a lot of difficulty establishing this connection and they were convinced I had no internet connection even though I did at that point). As a result of this monitoring and other testing, they diagnosed a very brief, intermittent drop out in the fibre-optic link between the surface box and the exchange. The 2nd line support engineer commented that this was a very strange fault because the fibre-optic connection normally either works or it doesn't.
    He called out a BT engineer to investigate the fibre fault. This engineer told me that he had "reset" the fibre-optic link at the surface box. Having done this, he couldn't find a fault so visited my house, undertook line checks, replaced my HH4 with a HH5, checked out all wiring, tested the socket etc monitored for 20 minutes, couldn't find any further fault and left. The problems have continued however and BT India support just keep running their standard line tests and finding no fault.
    I tried running a repeating ping test today using a tool called “WinPing”. I was using my BT email server for the ping test. The ping was set to 1 second intervals with the time-out set to a high level of 3000ms. I wasn’t using the internet at the time so I have no idea whether there is any correlation between the "timed-out" and/or slow response pings and the internet drop-outs that I have been suffering.
    The eight and a half hour test gave an average ping time of 45ms but there was a lot of variability;
    101 pings "timed-out" without a response (>3000ms).
    6 pings were between 2000ms and 2999
    23 pings were between >1500ms and 1999ms
    87 pings were between 1000ms and 1499ms
    139 pings were between 500ms and 999ms
    66 pings were between 250ms and 499ms
    428 pings were between 50ms and 249ms
    680 pings were between 40ms and 49ms
    12,296 pings were between 32ms and 39ms
    There were no periods of more than a few seconds where WinPing couldn’t ping the server so this test doesn’t explain why I get the frequent drop-outs of up to 2 minutes unless perhaps the problem is caused by short drop-outs causing my connection to reset? The message I get on my Laptop / Google Chrome when the internet connection drops-out is a “Resolving Host” message at the bottom left and, after a short delay, a screen appears saying "This webpage is not available. DNS Probe Finished. No Internet." Other devices come back with various message to the effect that there is no internet connection, even though the HH5 light remains blue.
    Do the ping test results indicate any particular issue or are these results normal?

  • Display average for line items

    I have a query with a fixed row structure basically line items restricting on specific cost centers. I have my column structure where my key figures are alone with date restrictions, etc. Part of my query requires the user to specify the date interval for the data they want to see: Production date: 8/01/2008 - 8/12/2008 for example, but instead of the total for that date range for each line item in my row structure, they want to see the month-to-date average of the production for that time period. I have tried to do the option of Average for all values under the local calculations, but it still gives me the total, so I'm assuming that only applies to the result rows. The option for aggregation is grayed out. Temporarily, I have given them an input variable to enter 12 for the number of days and done the division in a formula, but I don't want to continue to have to do that if there is a better way.

    We have implemented something similar using formula variables to calculate the number of days between an input date range interval. Ex. ZPRDDATE is the input variable they enter 8/1/2008 - 8/31/2008
    Have two formula variables which are derived from ZPRDDATE in auser exit:
    Start Date = From value of ZPRDDATE (8/1 in this case)
    End Date = To Value of ZPRDDATE (8/12 in this case)
    Build 3 formulas in your query:
    Start Date = Start Date variable
    End Date = End Date Variable
    Diff Daus = End Date - Start Date
    The n you can calculate the avg in a formula

  • Generation of Annual Leave Quota at a time for the whole  year

    Hi All,
    Kindly give some suggestions.
    I am working on Time evaluation. We have a quota , Annual leave which is now given on monthly basis, means lets 12 annual leave are for whole year and employee are getting 1 leave on each month.
    Now  my requirement is to give this quota at a time in the start of every year. That means all the 12 annual leave should be generated in the start of a year.
    When I select the option no pro rata calculation then I am getting all this leave in the start of the year. But when an employee is joined in the mid of the year then also 12 leave is been generated which is not correct.
    Please suggest me how to make this leave as prorated so that for new joinee , this leave is generated taking into account the period and generate the prorate value for the whole year at the time of joining.
    Thanks
    Tanuja.

    Hi Sikinder,
    I am using + time evaluation Status-2. We have to generate quota in PT60 for each period.
    Write now we are getting annual leave quota getting generated in monthly basis. We want to genarate whole quota  for the  year in the 1st month of the year.
    When I have given calender year in the accrual period , i am not getting any quota in the 1st month rather getting the whole quota in the end of the year.
    Please suggest me what to do.
    Regards,
    Tanuja.

  • Variable offset for date - a year ago

    I have this sales report with the following columns:
    1. Current Day Sales
    2. Month to Date Sales (this Year)
    3. Month to Date Sales (last Year)
    I'm using a range variable for 0CALDAY for column 2 (Month to Date Sales this year).  i'm having problem with column 3.  how is it possible such that the date is automatically assigned to last year's values?  using offset would mean -365, however, this may not work during leap years?
    please help

    Hi,
    Refer the 'Examples for using Variables' in 'Bex Query designer' of sap help..
    Examples for Offset Variables
    You want to use a query to carry out a comparison of two years.
    Year Comparison
    You want to compare the costs of a year of your choice with the costs of the previous year.
           1.      In the Query Designer, create a new structure and add a new Selection for each year that you require.
           2.      Only use one key figure (for example revenue) in this example query. Add this key figure to the filter or add it to the selection.
           3.      Use a characteristic value variable for the characteristic Calendar Year (0CALYEAR):
    Select the characteristic value variables for Calendar Year and, from the context menu (right mouse click), choose New Variables. The Variables Wizard appears.
    If you always want to reference to the current year automatically, use the SAP Exit variable 0CALYEAR (or as appropriate for another time characteristic).
           4.      Move the defined characteristic value variable into the selection.
           5.      Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
                                a.      Select the characteristic value variable and from the context menu, choose Enter Variable Offsets.
                                b.      Enter –1 as the offset and choose OK.
           6.      Choose OK.
           7.      Enter a description.
    Example: Use the name of the key figure, for example, revenue, for the name and use a text variable for the name of the calendar year. See Using Text Variables.
    When creating a new text variable, enter Replacement Path as the processing type, and choose calendar year 0CALYEAR as the characteristic with display as key.
           8.      Create a second selection with the same characteristic value variable and do not set an offset here.
    Also use a text variable in the description in this case.
           9.      Move the required characteristic into the rows.
       10.      Save the query.
    After execution, the query should appear as follows:
    Variable screen entry: 2002 (or no entry when using the SAP Exit Variable).
    Year Comparison
    A characteristic
    Revenue 2001
    Revenue 2002
    Value 1
    100.000
      90.000
    Value 2
    200.000
    180.000
    Value 3
    300.000
    400.000
    Comparison with Cumulative Previous Year Period
    For example: You want to compare the periods 1-8 of a particular year with the same periods for the previous year.
           1.      Create a new structure in the Query Designer and add a new Selection.
           2.      Move a key figure, for example, Revenue, into the selection.
           3.      Use a characteristic value variable for the characteristic Fiscal Year/Period (0FISCPER):
    Select the characteristic value variables for Fiscal Year/Period and from the context menu, choose New Variable. The Variables Wizard appears.
    Use the SAP Exit variable Current Fiscal Year/Period (0FPER) if you always want to reference to the current year.  If you set the variable as entry-ready in the Variable Editor, after executing the query, the variable screen then appears with which you can change the default values were necessary.
           4.      Move the characteristic value variable, such as OFPER, into the selection.
           5.      Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
           6.      Under Selection, choose Value Area and choose the tab page Variables.
           7.      Add the characteristic value variable, for example 0FPER, to the selection once again for the second value of the interval.
           8.      Select the characteristic value variable and from the context menu, choose Enter Variable Offsets.
                                a.      As an offset, enter -3 as the from value and 0 as the to value. Choose OK.
                                b.      Choose OK.
           9.      Enter a description, such as Revenue for current year.
       10.      Choose OK.
       11.      Select the selection and from the context menu, choose Copy and then Paste.
       12.      Now select the second selection and from the context menu, choose Edit.
       13.      Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
       14.      Select the characteristic value variable again and from the context menu (the right hand button), choose Enter Variable Offsets.
                                a.      As an offset, enter -15 as the from value and -12 as the to value. Choose OK.
                                b.      Choose OK.
       15.      Enter a description, for example Revenue for previous year.
    Also use a text variable in the description in this case.
       16.      Choose OK.
       17.      Move the required characteristic into the rows.
       18.      Save the query.
    After execution, the query should appear as follows:
    Variable screen entry: 01. 2002 to 08. 2002
    Comparison with Cumulative Previous Year Period
    A characteristic
    Revenue 01. – 08. 2001
    Revenue 01. – 08. 2002
    Value 1
    100.000
      90.000
    Value 2
    200.000
    180.000
    Value 3
    300.000
    400.000
    Two text variables replaced with characteristic values were used for the descriptions here. One is filled with the from-value for the column with an offset of 0 and a length of 3, the other filled with the to-value with an offset of 0 and a length of 7. You can find additional information under Example for Variable Replacement.
    Comparison of Cumulated Values for Two Years
    You may want to compare the cumulated values up to the current period of the current year with those of the previous year.
    For this example, use the variable 0FPER (current fiscal year period) and the variable 0P_FPER (your chosen fiscal year period). You use these two variables to set the interval limits.
           1.      In the Query Designer, create a structure with two selections:
    ¡        1. selection: Cumulative Amount for current year
    ¡        2. selection: Cumulative amount for previous year
           2.      With the first selection (cumulative amount for current year) , move the time characteristic 0FISCPER into the selection and select it.
           3.      Choose Restrict from the context menu (right mouse click).
           4.      Choose Value Area between as the selection and go to the tab page Variables.
           5.      Double click to choose the variable 0P_FPER as the from value and variable 0FPER as the to value. The result is an interval from the chosen period to the current period.
           6.      Define the second selection (cumulative amount for previous year) and proceed as for the first selection.
    ¡        Add the variable 0P_FPER as the from value and variable 0FPER as the to value here.
    ¡        Set an offset of –12 for both the from and the to values:
    Select the interval and from the context menu (right click), choose Enter Variable Offsets. Enter –12 for each.
    The result is an interval that has been moved 12 periods ahead.
           7.      Add the key figures and additional characteristics for the query.
    After executing the query, you get a variable screen for the variable 0P_FPER. You need to enter the start period in the current fiscal year.
    You can also suppress this entry by deactivating the indicator Entry-ready in the Variable Editor for the variable 0P_FPER and entering a default value (for example, 001.2001 for 2001). You only have to change this value once per year.
    You have now defined a query that compares the cumulative values for two years.
    The variables with SAP Exit delivered by SAP have the following behaviors:
    Variable 0FPER (current fiscal year period): Displays the values of the current fiscal year period.
    Variable 0P_FPER (any fiscal year period): Displays the values of any fiscal year period. You can set the fiscal year period in the variable screen when executing the query in any way you require.
    Variable 0FYTCFP (fiscal year up to current fiscal year period): Displays the values of the first period up to the current period of the current fiscal year.
    Variable 0FYTLFP (fiscal year up to previous fiscal year period): Displays the values of the first period up to the previous period (current period –1).
    You need to use the variables 0FPER and 0P_FPER in the above example for the comparison of cumulative values for two years.  When using the variables 0FYTCFP and 0FYTLFP, only values for one month are displayed for year transitions with an offset of –12.
    Regards,
    Prema

  • Steps for Period end closing

    Hi All,
    Can any one please provide me with the actual steps towards Period end Closing and year end closing for Financial Closing.By step I mean steps in order i.e which step will be followed by which one.
    This is urgent
    Pinee

    Hi
    http://www.sap-basis-abap.com/fico/sap-fi-month-end-and-year-end-activities.htm
    First you will have to close the Posting period in the Materials Management side. To do this use the T.Code MMPV and give the period that needs to be Opened. Once this is done you will not be able to Post any Material Documents in the previous period.
    Now at the Financial side you need to open the next period and at the same time you need to close the Previous period. This can be done in T.Code OB52
    here is the list for FI/CO year end closing check list:
    now i am sending one document with T.codes
    CLOSING ACTIVITIES
    1 Execute Report for Inter Company Activity & Journal Entries
    2 Open posting period for next yr (T.Code: OB52)
    3 Run Business Area's Assignment report. (T.Code: F.50)
    4 Review list of recurring journal entries (T.Code: FBD3)
    5 Execute Recurring Entries for A/R, A/P, G/L (T. Code: F.14)
    6 Process Parked A/R, A/P, G/L accounting documents (T.Code: FBV0)
    7 Final Cutoff for the Maintenance of Fixed Asset- Add Transfer and Retire (T.Code: ABUMN)
    8 Run Depreciation in Test Run and post (T.Code: AFAB)
    9 Verify Display Log for Depreciation Test Run (T.Code: AFBP)
    10 Capitalize AUC Assets if needed (T.Code: AIAB, AIBU)
    11 Enter Payroll Data to SAP (T.Code: CAT2)
    12 Verify Depreciation Balances with GL balances (T.Code: ABST2)
    13 Post Depreciation (T.Code: AFAB)
    14 Execute Asset History Report, and retire assets if needed (T.Code: S_ALR_87011963, ABAVN)
    15 Adjust specific depreciation areas if necessary (T.Code: ABCO)
    16 Reconcile AM sub ledger with GL (T.Code: ABST2)
    17 Check Bank Data (T.Code: S_P99_41000212)
    18 Review AR Open Items (T.Code: FBL5N)
    19 Review AP Open Items (FBL1N)
    20 Execute Pending Invoices(T.Code: MRBP)
    21 Clear Open Item for GRIR, freight (T.Code: F.13)
    22 Reconciliation of Financial Documents and transactional figures (F.03)
    23 Open new CO Posting Period: (T.Code: OKP1)
    24 Compare current (cost estimates) with last current price (Moving Avg) (T.Code: OKBH)
    25 Update current cost price to material master price field (T.Code: CK11N, CK24)
    26 Process Freight charges, Match SD freight to actual (T.Code: V-31)
    27 Review Internal Order Postings(T.Code: OKSA)
    28 Settle All Orders (T.Code: KO88)
    29 Verify All Post Goods Issue have been Invoiced (Billing Due List) (T.Code: VF04)
    30 Review SD Billing Doc from prior month that have not yet been released to accounting (T.Code: F.2D)
    31 Reconciliation of MM movements in Transit Intra-SAP to Non SAP
    32 Reconcile PI Inventory with SAP (T.Code: MI07)
    33 Perform Manual Adjustment if needed (T.Code: F-02, FB50)
    34 Verify balance of the GR/IR account (T.Code: MB5S)
    35 Post Accruals and Deferrals (T.Code: FBS1)
    36 Clearing of Cancelled Documents (T.Code: F-03, F-32, F-44)
    37 Check Profitability Segment Adjustment (T.Code: KISR)
    38 Aging Report-Reconcile GL balances with sub ledger balances AP (T.code: FBL1N, FBL5N, FBL3N)
    39 Check the check run numbers (T.Code: FCH1, FCHI)
    40 Bank reconciliation Data (T.Code: FF67 & FEBA)
    41 Enter Tax Journal Entry (T.Code: FB41)
    42 Reconcile GL balances with sub ledger balances AR/MM/AP (T.Code: F.03)
    43 Display Balance Sheet Adjustments (T.Code: F.5F)
    44 Post Balance Sheet Adjustments (T.Code: F.5E)
    45 Post Foreign Currency Valuation (foreign exchange) (T.Code: F.05)
    46 Check generic cost centers for posting with wrong accounts
    47 Correct wrong postings on generic cost centers
    48 Check Validation dates for Cost Centers, Cost Elements, CO area (T.Code: GGB0)
    49 Check COGI--for both month end and year end
    50 Doubtful receivables (T.Code: F104)
    51 Verify In-transit Inventory
    52 Reconcile PA to G/L (T.Code: KE5U)
    53 Post Cost Center Assessments and Distributions (T.Code: KSU5 & KSV5)
    54 Run CO-FI Reconciliation to balance (T.Code: KALC)
    55 Run BW reports P&L and Balance Sheet
    56 Maintain CO yr variant (T.Code: KCRQ)
    57 Fiscal Yr Balance carry forward AP/AR/AM (T.Code: F.07,
    58 Fiscal Yr Balance carry forward CO (T.Code: CXS1)
    59 Fiscal Yr balance carry forward FI (T.Code: F.16)
    60 Fiscal Yr balance carry forward PCA (T.Code: 2KES)
    61 Set Document number ranges - FI - new year (T.Code: OBH2, OBA7)
    62 Set Document number ranges AP/AR - new year (OBA7)
    63 Generate Financial statement Reports (T.Code:OB58) OR (T.Code: FSE2)
    64 Change Fiscal Year For Assets (T.Code: AJRW)
    65 Year end Closing-- Asset Accounting--final for year end (T.Code: AJAB)
    66 Close CO Posting Period : (T.Code: OKP1)
    67 Close Prior A/R Posting Period (T.Code: OB52)
    68 Close Prior A/P Posting Period (T.Code: OB52)
    69 Close Prior MM Posting Period (T.Code: OMSY)
    70 Reverse accruals and deferrals for the new month (T.Code: F.81)
    71 Reconciliation of Financial Documents from old fiscal year and new fiscal year (T.Code: FNSL)
    72 Load Balances, Budget Data for Cost centers, sales
    73 Update Retained Earning Account , balance carry fwd (T.Code: F.16)
    Month end closing Activities
    1. All the expenses including amortization, prepaid expenses, Preliminary expenses and accruals have been booked.
    2. Complete Bank Reconciliation (T.Code: FF67)
    3. Make sure that Sum of Inter company balances is Zero
    4. Suspense Accounts should be cleared regularly.
    5. Ensure that all documents related to MM & SD have been entered in system. (T.Code:F-22 & F-43)
    6. Ensure that all billing documents are released to accounting.
    7. Calculate Overheads on all process Orders (CO43)
    8. Technically complete all process orders which are fully processed (CORM).
    9. Calculate Variance (KKS1)à (Relevant only if Standard cost is calculated).
    10. Settle all process orders which are technically complete (CO88).
    11. Close All settled Process Orders
    12. Close MM period (Transaction Code: MMPV).
    13. Carry out GR/IR clearing (F.13) transaction
    14. Depreciation Run (AFAB) has been carried out for the month
    15. Close FI Posting period after the month end closing activity is over (T.Code:OB52)
    Year end closing Activities:
    1. Calculate production work in progress on process orders which are not technically complete. (CO88).
    2. Carry out Assessment cycle for Cost Centers.(T.Code: KSUB)
    3. All month end closing Activities should be carried out.
    4. Carry Forward Balances to next year
    (With TC: F.16 we can carry forward the balance to next year.
    With TC: OBH2 copy the number ranges to next year
    Open next year periods by selecting the Posting Period Variant.
    then test by posting the transaction in F-02)
    Hope ths helps
    Please reward points
    Sunil

  • Calculating Average dynamically in BW Report

    Hello experts,
    I need to create a report where in I need to display month wise billing qty along with the average qty,
    here 'billing qty' is a key figure and "avgqty" should be calculated dynamically.
    The formula for avgqty is :
    "average qty" = ("beginning qty" + "n" stock at month's end)/(n+1) where n is the monthly duration that the user gives in the selection.
    ex: if the user put from "01/2006" to "03/2006" in the selection screen for the  Calendar Year/Month  then  here n becomes 2, so:
    "avgqty" = (total qty for jan + total qty for feb + total qty for mar )/(2+1)
    Can some please let me know the procedure on how to pass this "n" value to the formula that I need to use for my "avgqty" calculation.  
    Thanks & Regds

    Hi Murali,
    i assuming You have your Month variable (MONTH)( user/entry).
    First create 1 Customer Exit variable (CUMMONTH)with interval value. Go to CMOD and write this code.
    DATA: L_S_RANGE TYPE RSR_S_RANGESID.
    DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
    CASE I_VNAM.
    WHEN 'CUMMONTH'.
    IF I_STEP = 2.
    "after the popup
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'MONTH'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW."low value = input L_S_RANGE-HIGH = LOC_VAR_RANGE-HIGH. "high value = input L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    ENDIF.
    ENDCASE.
    Now create a selection which have this variable CUMMONTH.( so that you get the summation of total qty from jan to qty of mar)
    Now, come to your (n+1) part.
    Create a formula variable (FUMMONTH)again customer exit having single value.
    write this code. (not full code ..try in your system)
    char l(1),
    char h(1).
    CASE I_VNAM.
    WHEN 'FUMMONTH'.
    IF I_STEP = 2.
    "after the popup
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'MONTH'.
    CLEAR L_S_RANGE.
    lm = LOC_VAR_RANGE-LOW+4(2)."low value = input month
    hm = LOC_VAR_RANGE-HIGH+4(2). "high value = input month
    ly = LOC_VAR_RANGE-LOW(4)."low value = input year
    hy = LOC_VAR_RANGE-HIGH(4). "high value = input year
    'write logic
    'for if user enter from 2005(ly) to 2006(hy)..
    ' subtract h-l and give it L_S_RANGE-LOW
    L_S_RANGE-LOW = subtract
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    ENDIF.
    ENDCASE.
    after this..
    Make a Formula named Avg Qty
    =NODIV((That selection)(name of formula variable +1))
    Hope i m clear.
    Regards,
    San!
    Message was edited by: San!

Maybe you are looking for

  • Performance syntax loop at  and read table

    in the routine , for reading one line in a internal table  , the syntaxe   loop at  xxx where   and read tabl exxx   with key     XXXX has a great difference on performance or not?

  • Hard time trying to 'Package Solution' - Access 2010 on Win 8.1 pro 64

    I got myself a brand new system (win 8.1 pro 64) a while ago, and with it, got a few problems as well. - If it makes any difference, I had an accdr and changed file extension to accdb, this is the  FE  I'm trying to 'Package' now -  It happens that a

  • Adding a refernce number to a form

    Hi Folks, I have a form on my website which acts as a questionanire. As the data is purely qualitative I've not set it up to insert the data into a databse, only to forward it via a formail page to my email address. I would however like to add sequen

  • Where is the burn cd icon at in the new version of itunes?

    This weekend, I was trying to burn a pearl jam show for a friend at work. I know the show has about 45 tracks; so it needs to be an MP3 cd. I believe I have to make a new playlist, and then drag and drop the files into mp3 format. But my question is

  • Inter company error

    Hi SD Gurus I have configured all the settings but while generating the inter company billing i am getting error(008006985  000000 Sales organization  is not define) and in vf04 billing due list  sales org, sold to party number are not display,billin