Actual - Previous Year not summing correctly

Hi,
I've tried two different MDX expressions to return the Actual GSV for this period last year.  They both work for individual periods but they don't sum correctly.
Ie if you review the results for several periods in Excel then as long as the periods appear across or down the page the results are correct. However if Period is the Page Grouping (the Filter) then the result is wrong.
The first expression doesn't return a total at all:
Create Member CurrentCube.[Measures].[Actual - Gross Sales PY]
As 
([Measures].[Actual - Gross Sales], 
ParallelPeriod(
[Date].[Period Hierarchy].[Fin Yr],1,
[Date].[Period Hierarchy].currentmember)),
NON_EMPTY_BEHAVIOR = { [Actual - Gross Sales] }, 
VISIBLE = 1 ,  ASSOCIATED_MEASURE_GROUP = 'Monthly Sales Forecast'; 
This version sums up all periods not just the two I've selected:
Create Member CurrentCube.[Measures].[Actual - Gross Sales PY expt]
As 
 Sum(EXISTING [Date].[Period Hierarchy].[Yyyy Period].MEMBERS,  
 ( ParallelPeriod( [Date].[Period Hierarchy].[Fin Yr],  
                   1,  
                   [Date].[Period Hierarchy].currentmember  
 ,[Measures].[Actual - Gross Sales])),
NON_EMPTY_BEHAVIOR = { [Actual - Gross Sales] }, 
VISIBLE = 1 ,  ASSOCIATED_MEASURE_GROUP = 'Monthly Sales Forecast'; 
Any help would be much appreciated!

Hi Walt,
The “.CurrentMember” function doesn't handle the multiple members, it means the MDX cannot handle a multi-select in Excel. 
If we are use SSRS report tool which allow us to pass a string into MDX query, it can hanlde multi-select request to get expected data. Here are some related threads about this topic for your reference, please see:
Sum the same period of this and previous year: http://social.technet.microsoft.com/Forums/en-US/7d9ca803-faf1-4879-a4da-919b77907af8/sum-the-same-period-of-this-and-previous-year?forum=sqlanalysisservices
SSAS MDX Get Previous Year data for a given date range, and day to day:
http://social.technet.microsoft.com/Forums/sqlserver/en-US/92945862-371a-45d0-a5cb-648b2a4180ab/ssas-mdx-get-previous-year-data-for-a-given-date-range-and-day-to-day?forum=sqlanalysisservices
Furthermore, I found a article regarding multi select – friendly time calculations in Analysis Services for your reference. Please see:
http://ditchiecubeblog.wordpress.com/2013/06/16/multi-select-friendly-time-calculations-in-analysis-services/
Regards,
Elvis Long
TechNet Community Support

Similar Messages

  • Sort Album by Artist/Year Not Working Correctly

    For the Beatles, I have bought 3 albums from iTunes - Please Please Me, With the Beatles and Magical Mystery Tour. For some reason, using the above sorting Magical Mystery Tour appears at the top of the list, despite the fact that the year field is correctly entered for all 3. There is no info in the 'Sort Year' field either. I have quite a good understanding of how the iTunes library works, but this has me baffled (and annoyed)

    dannycorker wrote:
    It appears they are, although I refuse to believe this is the accepted behaviour - has no one else complained about this?
    It could simply be a weakness is the way this was all designed. If you look at the information Gracenote uses, it's not unusual for all tracks on a 60's compilation album to be incorrectly listed as the same year, often the year the compilation was released. The same thing tends to happen with re-issued albums. That's down to whoever inputs the information into Gracenote for that album, often a bored record company employee.
    First of all, you could try changing the year for each documentary to the year the album was produced and see if that fixes the problem. If it does, then you have to decide how to handle it.
    Accept it as it is.
    Change the year for the documentary to the same year as the album and simply kid yourself that it's the correct year. (I'm not being flippant, but if the documentary is all footage from album release year, then "technically", the doumentary is from that 60's year.)
    Leave the year of the documentary track blank, but put the year (2010) into the track's "Comments" field instead.
    Propose a workable solution to Apple via Apple Feedback. (I am being a bit flippant now. Sorry, but you'll be in for a long wait before anything might change.)
    Get Gracenote to change their text fields, get the people who input the information into Gracenote to do so correctly and then get Apple to change iTunes to recognise those changes. (Now I am being very flippant. Good luck with this one!) Oh! And hope Apple never decide to change from Gracenote to someone else!
    Number 2 or 3 are probably your best bet.

  • Formula claculation in query is not summing correctly when details are remo

    have a report that totals 2 columns together and is at the work center level. when I remove the details the totals are wrong but when I show them it comes over correctly. Here is the scenario
    work center column a column b sum a+b
    XXX 2 2 4
    the details however bring in 3 and 5 & 8 for columns respectively. Why would the work center level be wrong. do I need to do anything special in my formula?

    Hi,
    Do you mean the<i> calculate result as propety</i> set to standard Deviation for those KF ? If so , we can not expect as how it would be if we select <i>summation</i>  for <i> calculate result as propety</i> .
    With rgds,
    Anil Kumar Sharma .P

  • Assets from previous year not showing up in AFAB

    Hi,
    Im trying to process depreciation in AFAB but assets that I have (depreciated in 2010) are not showing up for this new fiscal year. It says I only have 1 asset to depreciate.
    What could be the problem?
    Thanks,

    We depreciate monthly. If we look at table ANLA, it shows all of our assets created last year exist. Its just that when I run the asset balance report (s_alr_87011994) or AFAB for 2011, none of these assets show up. When running for 2010, these assets appear again.
    What is the reason they are not appearing?

  • Level 0 not sum correctly to upper level

    Hi There,
    I have issue here, for example, my level 0 number is like this:
    level0-1     $4500
    level0-2 $3000
    level0-3 $2500
    So the total supposely should be $10,000 at level 2
    However Essbase Excel Addin gives wrong total at level 2, such as 65700, for example.
    How can I fix that, I try "clear upper block" then default calculation, it doesn't fix it.
    Please help.
    Thanks

    A couple of questions:
    1) Are you sure that all level zero members are tagged as Store or Never Share?
    2) Are you sure that the parent = A + B + C?
    3) Is it possible that you are pulling the wrong parent?
    4) Is it possible you have a View/Data/something else dimension member that's changing what you view?
    This should be an easy test -- pull the children and the parent into an Excel spreadsheet (I am assuming the Excel add-in but the same goes for SmartView), ensuring that you got to the children by drilling down in the parent. Now do a lock and send of 1, 1, and 1. Now agg. The parent value better be 3. If not, you've got something funky going on in your outline.
    Regards,
    Cameron Lackpour

  • NoFilter vs Previous Year

    Hi All,
    I am new to BO/WEBI and I am facing an issue with a simple cost center report. My plan is to build a report with following structure
    Cost element │ Act. Month │ Plan Month │ Budget Full Year Current │ Budget Full Year Previous Year │
    and I am using following input controls
    Cost center (Single value)
    Fiscal Year/period (Single value)
    The columns contains following:
    Cost element: The Dimension “Cost element”
    Act. Month: The measure “Amount actual”
    Plan Month: The measure “Amount plan”
    Budget Full Year Current: The formula “Plan Total - Current year”
    Budget Full Year Previous: The formula “Plan Total - Previous year”
    The two formulas is made as below
    Plan Total - Current year:
    =NoFilter(Sum([Amount Plan])) Where ([Cost Center]=ReportFilter([Cost Center]) And [Fiscal year]=[Current year] And [Version]="Plan/actual version")  
    ([Current year] = Right([Fiscal year/period].[Fiscal year/period - Key];4) (I would have used Reportfilter, but for some reason it gives me all the values)
    Plan Total - Previous year
    =NoFilter(Sum([Amount Plan])) Where ([Cost Center]=ReportFilter([Cost Center]) And [Fiscal year]=[Previous Year] And [Version]="Plan/actual version")
    [Previous Year] = Left(Right([Fiscal year/period].[Fiscal year/period - Key];4);2)+ If(Right(ReportFilter([Fiscal year/period]);4)="2012";"11";If(Right(ReportFilter([Fiscal year/period]);4)="2013";"12";"13"))
    Now I am facing following issues
    The column “Budget Full Year Previous Year” is blank (properly due to a  #Multivalue-issue). How do I fix this?
    Is there a smarter way to find “Budget Full Year Current” and “Budget Full Year Previous”
    The column “Plan Total - Current year” is working, but this is properly because the variable choose all the year and the Input control filters the right year
    Thanks in advance
    Peter

    Hi Gill
    Yes I am using Bex as my data source. I have asked IT to make the selection within Bex, but it created some new issues
    IT made a measure for Budget Full Year Previous, which was based on Current year - 1. Unfortunately this only worked if the users choose this year (2014) and the Budget Full Year Previous would then be 2013. If the user select fx August 2013 the Budget Full Year Previous will again be 2013
    As an alternative IT suggested the selection should be in a prompt on the query. This could maybe work, but my report is quite slow so the user has to wait approx 2½ min each they change period.
    Thanks for reply
    Peter  

  • Laptop says 'This version of iTunes has not been correctly localised for this language. Please run the English Version'. Can anyone help please, have no idea what to do and haven't used laptop in over a year. iPad/iPhone have lost tunes from laptop too.

    my laptop will not open iTunes, as it just says 'This version of iTunes has not been correctly localised for this language. Please run the English version'. I have not synconised my iPhone 5S or iPad 2 with iTunes for well over a year. I noticed the music which had previously been put into iTunes has dissappeared from my phone and iPad. I also want to remove some movies from my iPad and iPhone and there is no way I can do this without being able to manually sync with the Laptop which is running windows 7. Has anyone else come across this and please can you help? I am no expert in fact I know very little about the Laptop, it is my Husbands baby but he doesn't understand anything to do with Apple including iTunes. I will need any advise explained step by step please.

    Hi Shelady,
    Try downloading and reinstalling the latest version of iTunes from the first link below. If that doesn't do it, the suggestions in the second article should resolve the installation issue.
    Apple - iTunes - Download iTunes Now
    http://www.apple.com/itunes/download/
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    http://support.apple.com/kb/HT1923
    -Jason

  • Closing Stock correction for the previous year

    Hi,
    We wish to do the closing stock correction of previous year (2006-07) by way of posting GRN and Issue entries on 31st March 2007. Will it corrcet the Opening Stock as on 1st April 2007!!
    Also will there be any issue while doing this work!!
    Thanks for your kind support and help.
    Best regards,
    Mohar

    Open the project in CJ20N. Go to menu bar path: Edit-> status-> Close. Save project. Please note that you must first have gone through the normal progression of status moves from CRTD to REL to TECO before you will be able to close. 
    You have costs on the WBS that need to be settled to a cost center or other WBS
    You have RA that still needs to be run and settled
    This can get comlicated if you are not doing full settlement as you will have to open up the past periods to fix it.

  • Capturing "Actual Amounts" from previous years

    Hi Experts,
    We had earlier developed a report to produce a list of projects which can be changed from status TECO to CLSD. If the project cannot be closed then the corresponding reason for failure should be displayed.
    Now the problem is that there were some direct costs which were booked under certain WBS elements. These elements were created in the previous year & haven't been settled in that year. Our present program isn't able to capture & display these costs in the current year. We have based our logic up on a join of table COBK with tables COEP, PROJ & PRPS. We are referring to the SAP standard TCODE s_alr_87013533 which is able to find the unsettled dollars (Actual amount) even from previous years. Anyone please help advise as to how we can even capture the actual amounts from previous years.
    Regards,
    Uday
    Our inner join statement is as shown below:
    SELECT coep~objnr coep~wogbtr coep~megbtr coep~wrttp coep~kstar
             coep~owaer coep~vrgng coep~sgtxt coep~ebeln coep~ebelp
             coep~objnr_n1 coep~belnr coep~gjahr coep~perio
             cobk~blart cobk~refbn cobk~refbk cobk~refgj
        INTO CORRESPONDING FIELDS OF TABLE tb_actual
        FROM coep INNER JOIN cobk ON cobk~kokrs = coep~kokrs AND
                                     cobk~belnr = coep~belnr
                  INNER JOIN prps ON coep~objnr = prps~objnr
                  INNER JOIN proj ON proj~pspnr = prps~psphi
        WHERE proj~pspnr  = wa_proj-pspnr   "project definition
          AND prps~pspnr  = wa_prps-pspnr   "WBS element
      AND prps~belkz =  c_x             "Account assignment
      AND coep~wogbtr <> 0              "amount
      AND coep~lednr = c_00             "Ledger (needed to hit index)
      AND coep~wrttp IN (c_04, c_11)    "actual value type - real & stat
      AND coep~beknz IN r_beknz.        "D/C Ind <> Settlement

    based on the data provided -
    I-001688               
    Cost line                       7143.28          71710000
    Cost line                     42874.74          73120000
    Cost line                     22752.77          73120000
    TOTAL COST     72770.79          
    Settlement line     65627.51          81650000
    Settlement line     7143.28          81650000
    TOTAL SETL     72770.79          
    you should be able to set CLSD to this project as there is no unsettled value in the project
    CJI3 report confirms that there is no outstanding settlement and hence project can be set to CLSD. This report shows all the line items against project
    The report S_ALR_87013533 shows the actual cost incurred in the project, but not settlement. This does not mean that the project is unsettled.
    see another report (project cost element report) - that might help you S_ALR_87013542

  • Reg:Allocation on previous year actuals

    Hi Experts,
                      I have an issue in allocation, i wrote allocation logic to allocate profit center by previous year actuals that was ok but if there are new profit center created for this year and there wont be any previous year actuals for it so he asks me to allocate the amount evenly to all the profit centers if that possile in Run allocation ?
    the script below
    *SELECT(%ACC%,"ID", "ACCOUNT", "TOPDOWNALLOC = 'Y'")
    *SELECT(%CurrencyList%,"ID","RPTCURRENCY","CURRENCY_TYPE = 'R'")
    *SELECT(%ENTI%,"ID","ENTITY","ID = %ENTITY_SET%" )
    *SELECT(%CATE%,"ID","CATEGORY","ID = %CATEGORY_SET%" )
    *SELECT(%TIME%,"ID","TIME","ID = %TIME_SET%" )
    *SELECT(%PTC%,"ID","PROFIT_CTR","ID = %PROFIT_CTR_SET%" )
    *XDIM_MEMBERSET RptCurrency = %CurrencyList%
    *XDIM_MEMBERSET CATEGORY = %CATE%
    *XDIM_MEMBERSET TIME = %TIME%
    *XDIM_MEMBERSET ACCOUNT = %ACC%
    *XDIM_MEMBERSET PROFIT_CTR = %PTC%
    *FOR %ACCT%=%ACC%
    *RUNALLOCATION
    *FACTOR = USING/TOTAL
    *DIM ENTITY WHAT =%ENTI%.INP ; WHERE=%ENTI%; USING=%ENTI%; TOTAL=%ENTI%
    *DIM CATEGORY WHAT=%CATE%; WHERE=<<<; USING=ACTUAL; TOTAL= <<<
    *DIM ACCOUNT WHAT=%ACCT%_INP; WHERE=BAS(%ACCT%); USING=BAS(%ACCT%); TOTAL=<<<
    *DIM DATASRC WHAT=INPUT; WHERE=INPUT; USING=UPLOAD; TOTAL=<<<
    *DIM PROFIT_CTR WHAT=BAS(%PTC%_IN); WHERE=BAS(%PTC%); USING=BAS(%PTC%); TOTAL=<<<
    *DIM COSTCENTER WHAT= NO_COSTCENTER; WHERE=BAS(1004322231); USING=BAS(1004322231); TOTAL=<<<
    *DIM TIME WHAT=BAS(%TIME%); WHERE=BAS(%TIME%); USING=BAS(2009.TOTAL) ; TOTAL=<<<
    *DIM RPTCURRENCY WHAT=LC; WHERE=INR; USING=IN; TOTAL=<<<
    *ENDALLOCATION
    *COMMIT
    *NEXT
    Regards,
    Vinoth

    Hi Vinoth,
    First, what REF_DATA is. Initially WHEN statement in BPC NW worked on members defined in your XDIM statements rather than records from your Application like in BPC MS. Starting from BPC NW 7.0 SP09 (7.5 SP04) default behavior of WHEN has been changed to be based on Application data. For compatibility purposes and to leave a choice of using Dimension data a new statement was introduced - *WHEN_REF_DATA. You can read in more details about it in OSS Note [Note 1474115 - Enable new keyword: *WHEN_REF_DATA for script logic|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1474115].
    So, based on what Profit Centers you have to use you have to put either *WHEN_REF_DATA=MASTER_DATA or *WHEN_REF_DATA=TRANS_DATA.
    I didn't understand why would you need multiple new Profit Centers. I can see 2 options of implementing your scenario:
    1. You create an Input Schedule that allows user to enter number of Profit Centers. Than you use that number in your RUNALLOCATION.
    2. You create a script that calculates number of Profit Centers and stores it in same Application. Than you use that number in your RUNALLOCATION.
    a) Your script calculates total number of Profit Centers and puts it on member NO_PC. Than FACTOR = 1/USING will be in RUNALLOCATION
    b) You populate value 1 on each Profit Center on some special Account. Than FACTOR = USING/TOTAL will be in RUNALLOCATION.
    You have to decide first which path is more convenient for you. Some of the considerations I explained in my previous posting. After than we can proceed with developing that script; otherwise there are too many unknowns in that task.
    Regards,
    Gersh

  • Need help with sum from previous years

    Hi All,
    In a report i have 4 fields. The first field shows the YTD invoice totals for the current FY 2010 (which i accomplished). The other 3 fields are :
    2nd field Sum of the value of invoices for the FY 1YEAR prior to the current year
    3rd field Sum of the value of invoices for the FY 2YEAR's prior to the current year.
    4th field Sum of the value of invoices for the FY 3YEAR's prior to the current year.
    How can i get the desired results for the second,third and the fourth fields, please need help or advice.
    Thanks

    Hi
    If you have the values for several years in the same report you should be able to do what you want using the analytic LEAD and LAG.
    LAG will retrieve values from previous rows whereas LEAD will retrieve values from following rows.
    The basic syntax is the same and look like this:
    LAG(value, offset) OVER ({optional_partition_clause} ORDER BY mandatory_order_clause)
    The ORDER BY clause is mandatory and cannot be omitted. However, this ORDER BY has nothing to do with the sort order you manually create in the worksheet. Generally, most people will set their sort order the same as the ORDER BY in the calculation.
    Here's an example that gets year to date from 2 financial years ago:
    LAG(YTD,2) OVER (ORDER BY FY)
    You have to understand that Discoverer will pull values from previous rows not from previous cells as displayed on the report, although if the cells may happen to be rows too then it will appear as though it is pulling previous cells. I personally am very experienced with analytuc functions and can make manipulate data within Discoverer just about any way that I want. Generally, if I can see data on the screen even when they are in different cells or rows I can create functions to manipulate it. This capability only comes about as a result of experience and I would strongly advise you to practice with the analytics and see if you can at least master some of them. You'll find your Discoverer capabilities will improve dramatically and you will become a great asset at work.
    When working with a new report I generally duplicate the report as a table so that I can see the values. Then if I need to sort the items in order to line up the values I want to work with I do so. Having worked out what sort order I need I can then see what offset I use then I create the analytic and use it in the main worksheet.
    Hope this helps
    Best wishes
    Michael

  • 50% credit on capital goods for previous year is not availed

    Dear All,
    The go-live date for my client was 01.10.2009. Now, in Apr, 2010 when the client is trying to get the 50% credit on Capital Goods (t. Code j2i8),  system is not generating any data of the previous year. (From Oct, 09 to Mar'10).  However, if we see the GL Balace for 'Cenvat On Hold A/c' as on 31.03.2010, it shows a  balance of Rs. 2.50 lakhs approximately.
    Can you please tell me why system is not showing any details through j2i8 for previous year?
    Thanks & Regards,
    Reshma

    Hello,
    The settings before 01.04.2010 were same.  However, after thorough checking of the GL A/cs, I have following observations -
    1) Plant 1 - Balance as on 31.03.2010 in Cenvat on Hold A/c -Rs. 195080. It is upload balance & t.code used is FBVB
        There are some more transctions in this A/c which are  reversed due to wrong entries.
        Balance in Excise Duty RG 23 C as on 31.03.2010 - NIL
    2) Plant 2 - Balance in Cenvat on Hold A/c as on 31.03.2010 is  Rs. 166701. Again this is an upload balance with FBVB
        Balance in Excise Duty RG 23 C as on 31.03.2010 - Rs. 56931.62
    3) Plant 3 -  No upload balance.  All the transactions are routed through J1IEX except 1 from FB01
        Balance as on 31.03.2010 - Cenvat On Hold A/c - Rs. 86876.06
                                                     ED RG 23C  - NIL
    Hence, would like to know -
    1) Any separate procedure to take the credit of upload entries?
    2) If the Balance in ED RG 23C A/c is NIL, will it affect on taking credit?
    Thanks & Regards,
    Reshma

  • HT1349 Not a Mac computer-have had ITunes on this computer for literally years.  This morning i am getting an error message trying to open Itunes - MSVCR80.dll not found, Not installed correctly Error 7 (Windows error 126).  DL would not work.  Help!

    Have had Itunes on this computer literally for years.  This AM message "MSVCR80.dll not found, not installed correctly Error 7 (Windows error 126) "- and could not download (it wanted a mobile device - I don't have one)
    Help!

    Solving MSVCR80 issue and Windows iTunes install issues.
    Thanks to user turingtest2 for this solution.
    Solving MSVCR80 issue and Windows iTunes install issues.
    If the above doesn’t do the trick entirely, then use the instructions in the following as it applies to the version of Windows you are using:
    HT1925: Removing and Reinstalling iTunes for Windows XP
    HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    You may be required to boot into safe mode to complete the folder deletion process.

  • TS3212 im trying to reinstall but will not allow, due to an error 7,  itunes helper not installed correctly,i have tried several times, but will not allow me to install, i have used itunes for years but now cant use it, can you help

    i have tried to reinstall itunes because it is saying i cant use my itunes due to an error 7, itunes helper not installed correctly, please reinstall, i have tried several times but still not allowing me to use, ive never had this problem before in all the years i have used itunes, i have gone through all the troubleshooting but still no access, can you help

    Many thanks.
    That suggests that another application has stashed old QuickTime componentry in your system files.
    So just in case we'll go looking for older QuickTime componentry in the most common locations for it to be stashed.
    First we'll need to change some view settings.
    In your Start menu, open Computer.
    In your Organise menu, select Folder Options.
    In the View tab, make sure that "Show hidden files and folders" is selected, and Hide extensions for known file types is unchecked.
    Click OK.
    Now in Computer, open your C:\ drive (or whichever drive you have your operating system installed on).
    Open the "Windows" folder.
    If you have a 32-bit version of Windows, open the "System32" folder.
    If you have a 64-bit version of Windows, open the "SysWOW64" folder.
    What files and folders can you see in there with QuickTime in the title? (In a standard installation of Quicktime you should be seeing precisely two files... QuickTime.qts and QuickTimeVR.qtx ... and no QuickTime folders whatsoever.)

  • P11D corrections in previous year

    Hi All,
    Does anyone know if there is a way to update the P11D values after the March payroll has been run? My understanding is that the P11D elements are read from the CRT, once you move into April you can't update the CRT from the previous year.
    Any suggestions would be much appreciated.
    Thanks,
    Mike

    Hi Michael
    Good day
    we have always processed the benefits for P11D reporting in April with a retro and the system was setup in a way to pick up the figures.Im talking of 2007-08 here however in case it changed not sure
    Also could be a custom setting which allows you to pick up the latest results
    Regards
    Ajay

Maybe you are looking for