@PRIOR function question

hi all, please explain me use of @prior(member, offset, range list) function
as I understand here:
member - a single member we want to return value of
offset - number of periods/some_members of range list
range list - members for offset choose
says, we have accounts
acc0
acc1
acc2
how should I define formula with @PRIOR function if I want calculate:
1) acc2=acc1 of previous N months, where N is stored in acc0
2) acc2=acc2 of previous N months, where N is stored in acc2 in custom_member2 of custom_dimension2

Hi,
Your question is a little hard to understand, so I will try to help by posting some information about the @PRIOR function and hoping it gets you moving.
It's important to remember that @PRIOR returns a numeric value. It's not a memberset function used to navigate the hierarchy. It's a function used to select one value from a set of values.
Typically, you just use it to step one month back in time and get the value of some account for use in the current month, like this:
"BegBalance" = @PRIOR("EndBalance");
What you don't see here is that this is taking advantage of the default values for the second and third arguments (the number of steps to go back, and the memberset to walk back through). The defaults are 1, and the-level-0-members-of-your-time-dimension.
Because I hate duplicating code in multiple fixes, specifying years in IF statements, and year-end maintenance, I tend to do something like this...
IF (@ISMBR("Jan"))
"BegBalance" = @PRIOR("EndBalance"->"Dec", 1, @LEVMBRS("Year", 0)); /*Note that you can cross-dim in the first argument*/
ELSE
"BegBalance" = @PRIOR("EndBalance");
ENDIF;
This is a good way to fix up code you inherit from consultants who only have to make things work in dev, don't mind nesting IF's and doing a bunch of double cross-dims to get from Jan to Dec, and are going to be long gone by the time the year rolls over. I'm sorry... have I gone off-topic?
The point is that you can use @PRIOR to pull numbers from elsewhere in the database, if you know what memberset you need to walk back through and how far back you need to walk. I presume you can use your acct0 as the second argument, since it's numeric, but you'll have to test that to see. You can also walk forward with @NEXT, if that helps you any.
Hoping you can find an answer in there somewhere,
-- Joe

Similar Messages

  • Prior function in MDX

    HI,
    I am converting an BSO to ASO so need to change the Member furmula in MDX. I need to to change the following Prior function to MDX:
    @PRIOR( "Measure1" -> "EOPTIME" -> "DCAP001", 12, @LEVMBRS ("DLOS014", 0))
    my doubts are:
    1. How to use cross dimension in Prior function as comma (,) but it will take as an argument in function and even i cann't use braces also.
    2. in MDX we can't use range in lag function. so how to use range in lag function in MDX or any other approach?
    Thanks in advance.
    Regards,
    Abhishek

    to do the prior, you would use the lag function. It looks like you are lagging back 12 periods so you would have to add the periods dimension into the touple.
    To get the members you would use a tuple which would be something like ( [Measure1],[EOPTIME],[DCAP001],[Periods].currentmember.lag(12))
    Put that inside a case statment like Case When ISleaf([DLOS014].currentmember) then

  • Help with @Prior function

    Hi,
    I have a requirement for member formula = (Forecast for CurMth - Actuals for CurMth) + (Forecast for PrevMth - Actuals for CurMth) / (Actuals for CurMth - Actuals for PrevMth)
    I am using the Prior function for this shown as below
    ( ( @PRIOR ("Monday Forecast",0,@CurrMbr("Periods")) - @PRIOR ("Actuals",0,@CurrMbr("Periods")) ) + ( @PRIOR ("Monday Forecast",1,@CurrMbr("Periods")) - @PRIOR ("Actuals",1,@CurrMbr("Periods")) ) ) / ( @PRIOR ("Actuals",0,@CurrMbr("Periods")) - @PRIOR ("Actuals",1,@CurrMbr("Periods")) ) ;
    I see that @ Prior function is not getting the values for the prev month scenario members. Any help would be appreciated guys.
    Thanks.

    Unless I have totally misunderstood your requirement, you are making this much more difficult than it needs to be!
    I would suggest the following steps...
    1. Read the Technical Reference entry for @PRIOR
    2. Get rid of all those @CURRMBR("Periods") specified as the range across which @PRIOR will operate (the third parameter). The range is an optional parameter which doesn't need to be specified if Periods is tagged as a Time dimension, and in any case, having a single member there is meaningless
    3. Don't use @PRIOR with zero specified as the offset - think carefully about what that means. You don't need @PRIOR at all to refer to anything in 'current month'
    Good luck!

  • SD & FI BI functional Questions

    Hi Experts,
    I need to ask some questions to customer on SD & FI functional related questions for BI Analytical reports..
    Already cutomer implemented Data ware house Informatica with congnos reporting tool.
    right now they want to implement BI.
    please any one can share on what type functional questions could ask the customer.
    Advance Thanks,
    Bala.

    Hi,
    A few more pointers.
    Start with Reports. What the client is using. What he is expecting.
    If he got existing reports map the fields with Business Content BW Fields. Go to Business content and make a list of queries which are delivered from SAP. Explain them the KPI's. This should be good to start with. Also check the Tcodes they use.
    Look for DataSources that get data from theses Tcode's.
    Project Preparation (Initial stuff -- Do a conceptual review after this phase requirements gathering)
    Collect requirement thru interviews with Business teams /Core users / Information Leaders.
    Study & analyze KPI's (key figures) of Business process.
    Identify the measurement criteria's (Characteristics).
    Understand the Drill down requirements if any.
    Understand the Business process data flow if any.
    Identify the needs for data staging layers in BW – (i. e need for ODS if any)
    Understand the system landscape.
    Prepare Final Requirements Documents in the form of Functional Specifications containing:
    Report Owners, Data flow, KPI's, measurement criteria's, Report format along with drilldown requirements.
    Hope this helps.
    Thanks,
    JituK

  • @Prior Function delleting entire data

    Hi,
    I have written a simple script using @Prior function which has to take the value of the previous month.
    Ex- X= @PRIOR(X)
    And i have saved the data for Mar month for X and ran the script. My April Month and other months should get calculated accordingly.
    But after the execution of the script my Mar data is also getting deleted.

    Hi,
    Although you have not provided much information, just for starters - Do you have any data in Feb? If not, that is the reason for Mar getting deleted.
    If you need to run this script for Monhs after Mar, refriuct your calc script rage using FIX(Apr:Dec)
    Cheers
    RS

  • Sumifs function question

    Hi, Everyone, I have a function question of Sumifs, here a sample as follows,
    =SUMIFS(Budget :: E4:E14,Budget :: C4:C14,"=5003677000",Budget :: B4:B14,OR("=Transit","=Drawing cash")), according to the logic, I think like this, but it's wrong. So how to insert the OR function to the Sumifs function? May someone find the mistake in the function?
    Thank you.
    Alex

    I think you would actually do a sum of simifs, i.e. Sumif(....."Transit") + Sumif(....."Drawing Cash")
    Basically if you have two sumifs that differ in only one condition that would be treated like an OR in SQL, then make one Sumif for each unique set of  conditions and add them up
    Jason

  • OIC: Functional Question(11.5.10)

    Hi All,
    I would like to know answer for the following functional question in Oracle 11.5.10 Incentive Compensation Application(OIC). I would greatly appreciate if you anyone can reply for this.
    1. Question on Foreign currency exchange rates:
    We know that OIC cannot handle foreign currency exchange rates. Since all of our offer letters to the Sales guys are in local currency what we end up doing is picking an exchange rate on July 1st every year and converting them to US $. What I’m wondering is why couldn’t we just set them up in OIC in their local currency, without converting them?
    Is that possible? OIC can handle this?
    2. In OIC, Can I enter a DUMMY Acoount Executive (since we are not going to credit any single person in the Primary Account Executive role) that bookings could be credited to in order to ensure they roll up to the appropriate manager?
    a) Is that possible?
    b) Does this DUMMY Acoount Executive should be part of the HR Employee setups as well?, In OIC should we need to load the transaction for DUMMY Account
    Executive so that credit will get rolled up to approriate managers based on the Group hiearchy setups?
    Thanks,
    Johnson
    Edited by: user10413783 on Jun 23, 2009 4:06 PM

    Hi Johnson,
    2. In OIC, Can I enter a DUMMY Acoount Executive (since we are not going to credit any single person in the Primary Account Executive role) that bookings could be credited to in order to ensure they roll up to the appropriate manager?
    Yes
    b) Does this DUMMY Acoount Executive should be part of the HR Employee setups as well?, In OIC should we need to load the transaction for DUMMY Account
    Executive so that credit will get rolled up to approriate managers based on the Group hiearchy setups?
    You do not need to set up the dummy resource as employee. All you need is to create as OTHER type of resource and add that resource to group.
    Hope this helps.
    Thanks
    Srini

  • Calculating Qtr2 with @PRIORS function

    Hi all,
    I am trying to calculate Qtr2 with @PRIORS function.
    The following script works: @PRIORS(SKIPMISSING, "Jun");
    Here is my issue:
    This logic will fail if there is no data in Apr, May or Jun. It will keep looking for the previous period with data, which could be Mar. And this would be a wrong value.
    Therefore, I would like to come up with a rangelist, just like the Tech Ref suggests: http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref/priors.html
    The following script does not work: @PRIORS(SKIPMISSING, "Jun", "Apr":"Jun");
    This doesn't work either: @PRIORS(SKIPMISSING, "Jun", "Apr","May","Jun");
    Any ideas?
    Thanks,
    Mehmet
    p.s. We are on version 11.1.2.1

    Hi Mehmet,
    If I understand you correctly, Jun data should be #mi if both Apr and May are #MI, and if May is #mi, but Apr is 100, then prior jun should be 100.
    IF (Apr > 0)
    @PRIORS(SKIPMISSING, "Jun");
    ELSE
    @PRIORS(SKIPNONE, "Jun");
    ENDIF;
    Regards,
    Robb Salzmann

  • Disabling 'Delete Prior' function

    Hi -- I'm curious if there's a way to disable the 'Delete Prior' function.  It is physically very close to the 'Mark Prior Read' 'button' which I use frequently and I am afraid of deleting all of my prior emails again.  It happened once by accident and my emails were instantly permanently deleted from both my Q10 and Outlook on my laptop.  Very frustrating.
    When deleting a single email, an option appears asking if I want to delete the email from the Hub or from the Hub and Server but the 'Delete Prior' function only warns me of deleting the messages and doesn't provide the Hub / Server option.
    Thank you in advance for any insights provided.

    That's a core feature built right in to the OS therefore there's no getting around it.
    Cheers.  
    - If my response has helped you, please click "Options" beside my post and mark it as solved. Clicking the "thumbs up" icon near the bottom of my response would also be appreciated.

  • Incremental updates on collections/full schedule - Functional question

    Hi everyone,
    At a customer of mine we have the following set-up:
    Almost all applications are deployed User Based
    Collections are used for targetting the applications
    Incremental updates are enabled on practically all collections which deploy applications
    For the moment this setup is active for 498 collections (out of 714  collections).
    Since it's not advised and Microsoft recommends to only have incremental updates active for 200 collections, I would like to change this setup by means of POSH. I have just finished writing it, but I still have a functional question:
    Which schedule time would be best to activate for the collections? Keep the standard value to update collection every 7 days?
    When would you activate "incremental updates"? Device collections with required software for faster deployment time?
    I only foresee the following "downside":
    We have a lot of applications who are available to "all domain users". When the AD-account is created, it will sync with SCCM and will receive their deployements. But by changing the update schedule to, let's say, 7 days.. They wouldn't be able
    to see and install these applications if the collections haven't been updated yet?
    Thanks for the insight with your experience!
    Kr,
    Sven

    Wow Jörgen, thanks for this information! This was something I haven't read about. Will keep this in mind.
    In your blog, you mention that you use this tool to keep track of performance issues. When do you feel that there are too many collections which have incremental updates enabled (by using the tool)?
    The last weeks/months, we have a lot of issues during OSD. We have collections to which the TS is deployed.
    In orchestrator we have a runbook to add workstations to SCCM + add workstation to collection + update membership of collection. But the update takes from 5 minutes to 40 minutes.. So this is the main issue that we have..
    @Andrew: Thanks for your contribution! I believe you are speaking of "Global Conditions"? I haven't used it either, but I thought that this had some downsides.. For instance, we target most of the applications "Used Based" (since MS is
    moving to user centric deployment). So if I target the application to the "all users" collection and create a "global condition" to only install when user is a member of a specific AD-group (for instance: Skype), then the user still sees
    "skype" in the application catalog and will have an error upon installing it when he is not a member of the skype AD-group.
    Maybe this is completely wrong what I'm saying.. Just did some brainstorming with collegues but haven't found the time to play with it in a test environment. @Jörgen: Please enlighten us if I'm wrong.

  • Performance issue and functional question regarding updates on tables

    A person at my site wrote some code to update a custom field on the MARC table that was being copied from the MARA table.  Here is what I would have expected to see as the code.  Assume that both sets of code have a parameter called p_werks which is the plant in question.
    data : commit_count type i.
    select matnr zfield from mara into (wa_marc-matnr, wa_marc-zfield).
      update marc set zfield = wa_marc-zfield
         where werks = p_werks and matnr = wa_matnr.
      commit work and wait.
    endselect.
    I would have committed every 200 rows instead of every one row, but here's the actual code and my question isn't around the commits but something else.  In this case an internal table was built with two elements - MATNR and WERKS - could have done that above too, but that's not my question.
                DO.
                  " Lock the record that needs to be update with material creation date
                  CALL FUNCTION 'ENQUEUE_EMMARCS'
                    EXPORTING
                      mode_marc      = 'S'
                      mandt          = sy-mandt
                      matnr          = wa_marc-matnr
                      werks          = wa_marc-werks
                    EXCEPTIONS
                      foreign_lock   = 1
                      system_failure = 2
                      OTHERS         = 3.
                  IF sy-subrc <> 0.
                    " Wait, if the records not able to perform as lock
                    CALL FUNCTION 'RZL_SLEEP'.
                  ELSE.
                    EXIT.
                  ENDIF.
                ENDDO.
                " Update the record in the table MARC with material creation date
                UPDATE marc SET zzdate = wa_mara-zzdate
                           WHERE matnr = wa_mara-matnr AND
                                 werks = wa_marc-werks.    " IN s_werks.
                IF sy-subrc EQ 0.
                  " Save record in the database table MARC
                  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                    EXPORTING
                      wait   = 'X'
                    IMPORTING
                      return = wa_return.
                  wa_log-matnr   = wa_marc-matnr.
                  wa_log-werks   = wa_marc-werks.
                  wa_log-type    = 'S'.
                  " text-010 - 'Material creation date has updated'.
                  wa_log-message = text-010.
                  wa_log-zzdate  = wa_mara-zzdate.
                  APPEND wa_log TO tb_log.
                  CLEAR: wa_return,wa_log.
                ELSE.
                  " Roll back the record(un save), if there is any issue occurs
                  CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
                    IMPORTING
                      return = wa_return.
                  wa_log-matnr   = wa_marc-matnr.
                  wa_log-werks   = wa_marc-werks.
                  wa_log-type    = 'E'.
                  " 'Material creation date does not updated'.
                  wa_log-message = text-011.
                  wa_log-zzdate  = wa_mara-zzdate..
                  APPEND wa_log TO tb_log.
                  CLEAR: wa_return, wa_log.
                ENDIF.
                " Unlock the record from data base
                CALL FUNCTION 'DEQUEUE_EMMARCS'
                  EXPORTING
                    mode_marc = 'S'
                    mandt     = sy-mandt
                    matnr     = wa_marc-matnr
                    werks     = wa_marc-werks.
              ENDIF.
    Here's the question - why did this person enqueue and dequeue explicit locks like this ?  They claimed it was to prevent issues - what issues ???  Is there something special about updating tables that we don't know about ?  We've actually seen it where the system runs out of these ENQUEUE locks.
    Before you all go off the deep end and ask why not just do the update, keep in mind that you don't want to update a million + rows and then do a commit either - that locks up the entire table!

    The ENQUEUE lock insure that another program called by another user will not update the data at the same time, so preventing database coherence to be lost. In fact, another user on a SAP correct transaction, has read the record and locked it, so when it will be updated your modifications will be lost, also you could override modifications made by another user in another luw.
    You cannot use a COMMIT WORK in a SELECT - ENDSELECT, because COMMIT WORK will close each and every opened database cursor, so your first idea would dump after the first update. (so the internal table is mandatory)
    Go through some documentation like [Updates in the R/3 System (BC-CST-UP)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCSTUP/BCCSTUP_PT.pdf]
    Regards

  • Basic Functionality Questions - Is a computer required to serve content, etc?

    I'm sorry if these are no-brainers. I ask them because I thought I had understood how an AppleTV worked, and had planned on buying one, until a friend who owns one insisted that the device functions differently than I had understood it to. I think he's wrong, but I was hoping you guys could clear up a few things for me.
    1) Does an AppleTV require that I have another device (iPad, Computer running iTunes, etc) on and connected to watch content purchased from my iTunes account, or will it stream directly from the 'net?
    2) If I've converted video content from a source other than the iTunes store (for example, ripped a DVD and imported it to my computer's iTunes library) can I stream it to my AppleTV (assuming the source computer is on?)
    3) Assuming #2 is true, the content in question must be served by a computer - ie, I can't move it to the cloud, and viewing it is dependant on having my computer on and running. Is this correct?
    Thanks in advance guys!

    1- it will stream purchased items such as TV shows, not music unless you have the  iTunes match subscription. You need another device if you want to do "home sharing" (share your iTunes library with other devices, If you have already bought movies, music, etc.)
    2- You will have to import it to iTunes if you want to see it on your ATV.
    3- Yes, you need to have a computer act as a server with iTunes running all the time...

  • An MM functional question

    Hi all,
    I have a question like
    Report has to extract the details related to invoices and payments to Vendors for the list of Purchase Orders for goods and services procured which are selected in the input screen. The report should calculate the time in days,   from   when the Purchase Order (services/goods) is released and till the time payment is made to the Vendor. It should take into account the invoice document posted and the payment terms for the Vendor in order to get the correct due date. It should give the difference in terms of days between invoice due date and payment date and indicate whether the payment was done before or on the due date.
    Iam confused with the flow becz iam not able to relate the ekbe (po history) and the BSIS , BSAK table to get the vendor data as the ekbe (belnr shows the material document No) and the the BSIS and BSAK shows the (A/c document No).
    can any one help me in this this is a urgent requirement.
    Thanks,
    SriRatna

    SriRatna,
    Pl let me know your email address so that I can email you the material prepared by me, this will give you complete overview of getting the data from different tables and their relationship based on the scenarios we commonly face in all different functional modules.
    Thanks,
    Sridhar Kamisetti

  • How to use a @PRIOR function with a SubVar in a cross dim formula?

    Hi all,
    I have a pretty basic logic to calculate a member:
    Rate = Account1->Entity->Prior Forecast Year / (Account2->Entity->Prior Forecast Year + Account3->Entity->Prior Forecast Year);
    We have a SubVar for the Current Forecast Year, so in my formula I wanted to use @PRIOR(&CurFstYr)
    I got an error message: expected type [MEMBER] found [NUMBER] ([@PRIOR]) in function []
    The calc validates and runs with no errors if I use &CurFstYr only, which gives me the option to create a Prior Forecast Year subvar: &PriorFstYr. Is this my only option?
    I've also tried using SUMRANGE function. The formula validated for @PRIOR(&CurFstYr). Eventhough the calc script validated, the calc stopped after 3 seconds with the below error message:
    Error executing formula for [Rate] (line 0): invalid object type
    Any idea why the SUMRANGE calc failed to run? Also, once again, is my only option to create a new SubVar for the Prior Forecast Year?
    Thanks,
    Mehmet
    Edited by: Mehmet Sevinc on Mar 2, 2012 12:14 PM
    Edited by: Mehmet Sevinc on Mar 2, 2012 12:29 PM

    You have this:
    Rate = Account1->Entity->Prior Forecast Year / (Account2->Entity->Prior Forecast Year + Account3->Entity->Prior Forecast Year);I don't have Essbase fired up, but I wonder if this would work:
    Rate = @PRIOR(Account1->Entity->&CurFstYr, 1, "Years") / (@PRIOR(Account2->Entity->&CurFstYr, 1, "Years") + @PRIOR(Account3->Entity->&CurFstYr, 1, "Years")) ;You can put a cross dim into a @PRIOR statement, but you will need to specify the dimension unless it's whatever is tagged as Time. My guess is Years is not the Time dimension.
    I'll bet the @PRIOR doesn't make things fast.
    Regards,
    Cameron Lackpour
    Edited by: CL on Mar 2, 2012 6:26 PM
    Forgot the first @PRIOR

  • Oracle XE Functionality Question

    Hello,
    I am here trying to get the opinion of Oracle XE users regarding a project I am considering.
    Currently, my employer uses Access databases, with the master on a corporate server, and 4 slaves on local servers at warehouses. At each warehouse, there are probably 10-30 new records created per day by 2 or 3 users at each location, which get synced to the main at the end of each day. Any changes that need to be made at the corporate level get synced and sent on to the warehouse as needed.
    Besides sending out these changes, the corporate office will also add 40-50 records per day. Information is also pulled for reports- seemingly pretty normal Access tasks. I don't know the exact stats, but each backed up copy of the DB is less than 100mb, so it's not a huge system. (It's for keeping track of inbound and outbound shipments, carriers, locations, etc.) There are probably 6 users at this location.
    So the question I have is, would XE have the functionality to at least cover these tasks, and possibly more. (What more is at the moment, I do not know.) My own preference would be to grow into Oracle DB, but if the Access functions cannot be replicated, we would probably move on to something else, so I thought I'd ask for current user experience.
    Thanks for your time.

    Hi,
    I think application running on XE and Apex suits for your current situation perfectly.
    And if system gets bigger you can get license of "full" Oracle database and upgrade.
    Using single database server and web application everything is "online" and you do not need transfer any data end of day.
    XE 10G database comes with Apex 2.1. That Apex version is quite old.
    But you can upgrade Apex to latest one.
    http://www.oracle.com/technetwork/developer-tools/apex/overview/index.html
    There is coming XE 11G that ship latest Apex and features that 10G do not have.
    You can also save more user data to XE 11G. But I assume XE 10G 4GB limit is enough for you.
    http://www.oracle.com/technetwork/database/express-edition/11gxe-beta-download-302519.html
    Regards,
    Jari
    Edited by: jarola on Aug 16, 2011 11:31 AM
    I did find this blog that is actually running on XE and Apex
    http://www.apexninjas.com/blog/f?p=100:1:1421570076381594::::P1_ARTICLE:
    I think you can not run blog application on MS Access =)
    Also I think Oracle database have much more features than Access, specially with Apex.

Maybe you are looking for

  • Budget exceed error while unreleasing the service entry.

    Hi experts, My problem is the systm generating budget exceed error while unreleasing the entry sheet in current fiscal year. Entry sheet is released in privious fiscal year. User want to reverse this in current year. All budget(actual/commitment) are

  • How to change the type of letters

    To show me how to change the letters

  • Removing file extension using REGEX

                    // User didn't add the XLS extension; add it automatically                 if (file.getName ().lastIndexOf (".") > 0)                     fileName = file.getName ().toLowerCase ().replaceAll (".*$", ".xls");                     System

  • Notes on Asha 311

    I can't find notes on my Asha 311. But according to official specification in nokia website, asha 311 does have notes. So where canI find my notes? Thank you.. Solved! Go to Solution.

  • Losing hotspot personal when updating ios8 onn ipad air

    my device is ipad air 16gb 4G . on ios 7 i can use hotspot personal , but when i update ios 8 , i can't find hotspot personal under cellular in settings . somebody has problem like this ??????