Function to retrieve ancestor member

Hi All,
I'm having issues retrieving an ancestor in a calc script on 9.2.0.1.
I am calc'ing a Level0 entity (in the fix statement) and Im trying to say that it equals its "grand" parent. For example:
ParEnt
- Child01
-Child001
Child001=ParEnt
I need a function because this calc gets repeated for various Level0 entities.
I thought @ANCEST or @ANCESTORS or @PARENT would work but I dont seem to be able to get it right and keep getting:
"Error 1200370 Error calculating formula: attempt to cross a null member in function [@X]"
I have tried:
@ANCEST ("Entities",5)
@ANCEST (@CURRMBR("Entities"),5)
Also tried -2 instead of 5 to indicate a Level number. It works with -1 (Level1) or 2 (generation 2) but not with the generations or levels that I need (5 and 2 respectively).
There are definitely at least 2 levels for every combination.
Ive also tried @PARENT(@PARENT("Entities")) but this only returns the value of the parent member, not the parent of the parent.
Any ideas what the correct function should be?
One more thing...All the above functions DO validate but I get the error when the execution of the calc script.
Thanks for your help.
Seb

Hi Seb,
Not sure if i am understanding this correctly, but from your post you say you want Child001=ParEnt.
If for one account member:
FIX(@RELATIVE("Entities",0))
ACCOUNT = @PARENTVAL("Entities",ACCOUNT);
ENDFIX
Or, if for a number of accounts use a static single member in the formula, i.e. SCENARIO
FIX(@RELATIVE("Entities",0), @DESCENDANTS(ACCOUNT))
SCENARIO = @PARENTVAL("Entities",SCENARIO);
ENDFIX
You can also change PARENTVAL to ANCESTVAL, see admin guide for the syntax
J

Similar Messages

  • Call a java function on retrieval

    Hi,
    Is it possible to call a java function on retrieval from a member formula or may be business rule. Will it be more efficient than the member formula itself ? Currently our member formula on dynamic member is timing out.
    It'll be nice if you could point me towards some material to read on and experiment.
    Any pointers will be helpful.
    Thanks.

    >> if I'm wrong but this CRC will work only if my data is in database tables
        Data dynamically retrieved from Essbase VIA APS with using MDX queries
    >>dynamic calc member is retrieving and calculation data from the planning cube itself.
      No . It ONLY for stored member.
      I need reduce using DCALC
    >> Do you have any more detailed info on how to deploy this and how to call this in member formula or calc script
      Just now i don have any detailed document for this. But
       1)  You need to know about Essbase Load Rules, Maxl Load Data, MDX data retirvies.
       2)  You need advanced PL-SQL experience for using it

  • Function to retrieve all days of the previous month.

    Hi,
    Yes, it's a monthly report i've been given the task to achieve.
    So, all I need is all days of previous month (even if there is no data for this day)
    I've been instructed to use the following code, but it does not return any value:
    DECLARE
       CURSOR CUR_LAST_DAY IS
          SELECT TO_CHAR (LAST_DAY (ADD_MONTHS (SYSDATE, -1) ), 'DD')
            FROM DUAL;
       VVA_LAST_DAY   VARCHAR2 (2);
       VNU_JOUR       NUMBER       := 0;
    BEGIN
       OPEN CUR_LAST_DAY;
       FETCH CUR_LAST_DAY
        INTO VVA_LAST_DAY;
       CLOSE CUR_LAST_DAY;
       WHILE VNU_JOUR <= TO_NUMBER (VVA_LAST_DAY) - 1
       LOOP
          VNU_JOUR := VNU_JOUR + 1;
       END LOOP;
    END;
    --CLOSE CUR_LAST_DAY
    --DEALLOCATE CUR_LAST_DAY-----
    On the other end, i've developped this code:
    SELECT TO_CHAR(SYSDATE,'dd')
    FROM DUAL
    WHERE TO_CHAR(SYSDATE,'dd') >= to_char(to_date(to_char(ADD_MONTHS(SYSDATE, -1),'yyyy-mm')||'-01'),'yyyy-mm-dd')
    AND TO_CHAR(SYSDATE,'dd') < to_char(LAST_DAY(to_date(to_date(to_char(ADD_MONTHS(SYSDATE, -1),'yyyy-mm')||'-01'),'yyyy-mm-dd')));Which is returning a null value. :(
    Regards

    Hello,
    You want to retrieve complete days of last month from one query...so here it is..
    SELECT
    TO_DATE(LEVEL||'-'||TO_CHAR(ADD_MONTHS(SYSDATE,-1),'MON-YY'),'DD-MON-YY') COMP_DATE,
    TO_CHAR(TO_DATE(LEVEL||'-'||TO_CHAR(ADD_MONTHS(SYSDATE,-1),'MON-YY'),'DD-MON-YY'),'DD') ONLY_DD,
    TO_CHAR(TO_DATE(LEVEL||'-'||TO_CHAR(ADD_MONTHS(SYSDATE,-1),'MON-YY'),'DD-MON-YY'),'MM') ONLY_MM,
    TO_CHAR(TO_DATE(LEVEL||'-'||TO_CHAR(ADD_MONTHS(SYSDATE,-1),'MON-YY'),'DD-MON-YY'),'YY') ONLY_YY
    FROM DUAL
    CONNECT BY LEVEL <= TO_NUMBER(TO_CHAR(LAST_DAY(ADD_MONTHS(SYSDATE,-1)),'DD'))I am not at database machine so therefore not tested.
    But one thing keep in mind that this forum only for reports there is separate forum for sql and pl/sql.
    Function to retrieve all days of the previous month.
    -Ammad
    Edited by: Ammad Ahmed on Apr 22, 2010 10:53 PM
    Spelling Mistake

  • BAPI or Module Function to retrieve PO attachment

    Hi,
    i want to retrieve and display the PO attachment list and PO attachment . I can retrieve all PO Informations(PO Header, , Item ,...), via table EKKO and EKPO but i couldn't retrieve and display PO attachment.
    The attachment is created via the ME22.
    Thanx

    duplicate of
    BAPI or Module Function to retrieve PO attachment

  • Function to retrieve event parameters from job

    Hello,
      Is there a function to retrieve the event parameters for a job.
      This job is triggered by an event.
    Regards, Michel

    Check in TBTCP and TBTCO Table there in some field it i s mentioned..
    TBTCP and TBTCO is the table which stores job details ..

  • Forms API. Function to retrieve/set Frame Line Width

    HI,
    I am writing a program using the API to check standards conformance, but cannot find the function to retrieve the Frame Line Width. Any ideas?
    Cheers,
    Neil

    Forms API header file D2FGRA.H (for graphic objects) contains macros for geting/seting some frame properties, for example:
    #define d2fgrag_frame_align(ctx, obj, val) \ d2fgragn_GetNumProp(ctx, obj, D2FP_FRAME_ALIGN, val)
    but not for geting/seting property "Frame Line Width".
    So, we must use functions
    d2fgragn_GetNumProp(ctx, p_obj, PROPERTY, val)
    d2fgrasn_SetNumProp(ctx, p_obj, PROPERTY, val)
    (GetNumProp because "Frame Line Width" is number-valued property).
    Property D2FP_LIN_WID ("Line Width") mentioned in Forms help "Graphics object API properties"
    don't exists in header file D2FDEF.H, but you can find property D2FP_INTERNAL_LIN_WID:
    #define D2FP_INTERNAL_LIN_WID 225
    So, use:
    d2fgragn_GetNumProp(ctx, p_obj, D2FP_INTERNAL_LIN_WID, val)
    Regards,
    Zlatko Sirotic

  • How to retrieve a member set by a certain value?

    Hi everyone,
    I'm having a problem trying to retrieve a set of entity members that have a certian value in an account.
    For a UDA or an attribute there are functions that solve this very problem but I can't figure out how to check on a value.
    For example if I'm trying to allocate a value to entities that contain a '1' in account 'Flag' I cannot find a member set function that would work.
    "Plan"=@allocate("Revenue"->"Plan",@ismbr("Flag"==1)),&PriorYear->"ACT",,share)
    This code doesn't work because the @ismbr function expects a member and not a boolean.
    Alternatively would it be possible to save a member selection so that I can loop through all entites and add them to a selection one by one?
    Thanks for your help :)

    Planning, eh? :)
    I think if you took your calc and stood it on it's head, you might get the calc range you want.
    Here's my (theoretical) idea.
    You're already (I assume) creating a calc block in a calc script/HBR to do the Plan calculation in the first place.
    I wonder if this would work:
    FIX(level 0 dimension members of whatever dimension)
    "Plan"
    IF("Flag" == 1)
    "Plan" = @ALLOCATE("Revenue"->"Plan", @HIERARCHICALFUNCTION("whatever"), "Revenue"->"ACT"->&PriorYear, , share) ;
    ENDIF
    ENDFIX
    The goal is to have the IF statement trump the range in the @ALLOCATE. I'm not sure it would work but it might be worth a try.
    Your @ALLOCATE is really just child member / parent member * basis. You could just roll your own:
    FIX(level 0 dimension members of whatever dimension)
    "Plan"
    IF(@ISMBR("Flag" == 1))
    "Plan" = ("Revenue"->"ACT"->&PriorYear / @PARENTVAL(whatever dimension, "Revenue"->"ACT"->&PriorYear)) * "Revenue"->"Plan" ;
    ENDIF
    ENDFIX
    Regards,
    Cameron Lackpour

  • Function to verify if member exists in outline?

    Hi guys,
    Need your suggestions on Essbase Excel VBA functions. We have a report built in Excel that is using some Essbase VBA functions. Now in this report we want to add an extra functionality
    where the report when ran should check if the member entered is there in hierarchy. Do we have any function or logic to get this result. I am thinking like using EssVCell and retrieve the value.
    if we get #VALUE, the member dont exist in hierarchy.
    Thanks,
    PM

    Okay, this is not me writing, but MMIC, Glenn Schwartzberg whose dedication to OTN is so great he IM'd me and asked me to post the following:
    1) First ask if he is using smart view or the add-in. If the add-in then the easiest way would be to use the outline API.
    2) I can't get to the specific calls, but you do something like open the outline read only and then search for the member
    3) I did something like it in my 2008? kaleidoscope conference presentation in New Orleans (Glenn, yes, you did do this at Kaleidoscope 2008).
    4) He could probably search and find it.
    Glenn's right, naturally -- go to www.odtug.com, then under Technical Resources, then search for one of Glenn's presentations -- he's presented a bunch of them, but I think this one has "API" in the title.
    Regards,
    Cameron Lackpour

  • Missing Functionality - Records retrieved by this Query)

    Hi
    The 'Records retrieved by this Query' function which was available in previous versions is now not available in 2007.
    Upon executing the query, the number of records do appear on the left but it can be awkward as the column doesn't size correctly for larger numbers for numbers over 100.
    Please can this be reintroduced.
    Many thanks,
    Caroline

    Hi Caroline,
    The response from SAP support team could be weeks or months if any.  You need more patient.  However, as in my experience, anything taken out from the previous version would have reasons.  Even unknown to most users, to get them back is highly unlikely.
    Thanks,
    Gordon

  • Using hsgetvalue function to retrieve Hyperion Planning Data

    Hi All,
    Lots of discussion about hsgetvalue, but still I do not succeed in using this function. Maybe someone can help.
    Is this function work for HFM or also Hyperion Planning? Currently we are using Hyperion Planning 11.1.1.3 with related Essbase. This is what we've tried in Excel:
    =hsgetvalue(“";”Scenario#BudFin;Year#FY12;Period#Begbalance;Partner#NA_Partner;Product#A251;Account#BOM Weight;Version#Working;Misc#R-SBDA;Entity#No Entity;Currency#Qty") ===> the result is syntax error.
    =hsgetvalue("","Scenario#BudFin","Year#FY12","Period#Begbalance","Partner#NA_partner","Product#A251","Account#BOM Weight","Version#Working","Entity#No Entity","Currency#Qty","Misc#R-SBDA") ===> the result is No Connection.
    Actually I'm still confused about the Connection parameter, which connection name we have to use?
    Thanks.
    Gajah

    Hi,
    HsGetValue
    Data sources: Financial Management, Hyperion Enterprise, Essbase
    HsGetValue retrieves data from the data source for selected members of a dimension. When HsGetValue retrieves no data, the value specified for the #NoData/Missing Label replacement option is used.
    When users select Refresh or Refresh All, only HsGetValue is called. When users select Submit, HsSetValue is called first, HsGetValue is then called only if HsSetValue returns successfully.
    Syntax
    HsGetValue(“Connection”,”POV”)
    Connection parameters can have these values:
    Empty: the default connection
    HsActive: the active associated connection
    The user-defined name for a private connection
    You connect to data sources through shared or private connections.
    _# Shared Connections_
    Shared connections are stored in a central location and are available to multiple users through the Smart View Panel. You cannot add, edit, or rename shared connections, but you can save them as private connections, which you can edit and rename.
    _# Private Connections_
    Private connections are those that you create by saving a shared connection to your local computer or by entering a URL to a provider that is not configured for shared connections. When you create a private connection, it becomes the active connection.
    Creating Private Connections
    You can create a private connection from a connection that is not listed in Shared Connections if you know the URL.
    To add a connection using a URL:
    1. From the Smart View ribbon, click Panel.
    2. From the Smart View panel, click the arrow next to "Home" Icon, and then select Private Connections.
    3. In the text box, enter the URL or the local storage directory for the data source to which you want to connect. The URL syntax for the various data sources is as follows.
    Financial Management: http(s)://servername:port/hfmofficeprovider/hfmofficeprovider.aspx
    Hyperion Enterprise: http://servername:port/heofficeprovider/heofficeprovider.aspx
    Planning: http(s)://servername:port/HyperionPlanning/SmartView
    Essbase: http(s)://servername:port/aps/SmartView
    Reporting and Analysis: http(s)://servername:port/raframework/browse/listxml
    Financial Close Management: http://servername:port/fcc/servlets/smartview/fcmsvservlet
    Oracle Hyperion Strategic Finance: http://servername:port/StrategicPlanning/SmartView
    4. Click Next Button
    5. Enter the Name of the connect as "Essbase_Conn"
    6. Enter username, password and connect the worksheet.
    Now you can create functions by two methods -
    1. Using Function Builder
    2. Manually (Which you have opted)
    To create a function manually:*
    1. In Excel, click the cell in which you want to enter the function.
    2. Enter = (equal sign).
    3. Enter the function name, HsGetValue, for example.
    4 Enter parameters for the function,
    HsGetValue(“Connection”,”POV”)
    Connection parameters can have these values:
    # Empty: the default connection
    # HsActive: the active associated connection
    # The user-defined name for a private connection
    so the function looks like this:
    HsGetValue(“Essbase_Conn”;"Year#Jan;Measures#Sales;Product#100;Market#East;Scenario#Actual")
    5. To refresh the worksheet, from the Smart View menu, select Refresh. Functions are validated only when you refresh them.
    REFERENCE: Chapter 2 & Chapter 15 of the SmartView Guide at http://docs.oracle.com/cd/E17236_01/epm.1112/sv_user.pdf
    KosuruS
    Edited by: KosuruS on Jul 12, 2012 9:55 AM

  • Function to retrieve long text in FI document for payment file

    Hi
    Is there a function i could use to retrieve the long text in the invoice document for the payment reference field in the payment file?
    Would appreciate your urgetn advice.
    Thanks.

    Possiblity could be that you have passed the wrong object name id or any parameters.
    See below the similar code.
    If you want to know the correct tdobject and correct tdname combinations go to table STXH and under name give the document number ie 1900000000 ie docno then you will come to know the correct tdname and object and tdid from which you can use the read_text function module
    DATA : tdobject TYPE thead-tdobject,
               tdname   TYPE thead-tdname,
               tdid     TYPE thead-tdid,
               tdspras  TYPE thead-tdspras.
      DATA : lines    TYPE STANDARD TABLE OF tline INITIAL SIZE 0,
             wa_lines TYPE tline.
    CONCATENATE bkpf-bukrs bkpf-belnr bkpf-gjahr INTO tdname.
      tdobject = 'BELEG'.
      tdid     = '0005'.
      tdspras  = sy-langu.
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
    *     CLIENT                        = SY-MANDT
          id                            = tdid
          language                      = tdspras
          name                          = tdname
          object                        = tdobject
    *     ARCHIVE_HANDLE                = 0
    *     LOCAL_CAT                     = ' '
    *   IMPORTING
    *     HEADER                        =
        TABLES
          lines                         = lines
        EXCEPTIONS
          id                            = 1
          language                      = 2
          name                          = 3
          not_found                     = 4
          object                        = 5
          reference_check               = 6
          wrong_access_to_archive       = 7
          OTHERS                        = 8.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ELSE.
         READ TABLE lines INTO wa_lines INDEX 1.
         IF sy-subrc = 0.
           write at 51(10) wa_lines-tdline.
         ENDIF.
       ENDIF.
    Regards
    Gopi

  • How to test the UDA or Attribute of an ancestor member

    Hi everybody !I would like to know how to test the UDA or attribute (I can use both) of the ancestor (or the parent of the parent) of the current member please ?(the current member is on level 0 et the ancestor is on level 2).I tryed some syntax but any result :(Thanks very much for your help... JaspePS : Sorry for my "bad" english, i'm french...

    You can try using this IF conditional statement:if (@count (skipnone, (@uda (dimName, myUDA) and @ancest (@currmbr (dimName), -2))) == 1)where:dimName is the dimension of the level 0 member you are testingmyUDA is the UDA you are testingWhat this does is it counts the number of members that meet two criteria. First, it must have the UDA you specify and, second, it must be an ancestor of the current member at a specified level.If the current member has a level 2 ancestor with the UDA, it should return one member.

  • Dynamic function to retrieve info from any of the remote db(dblink)

    Hi Guys,
    I’m in process of designing a function in an environment where dblink is used. We currently have more than 250 databases which all have a standard schema called XYZ with set of standard tables which holds info about the local database/application...
    We would like to add a function to our Apex application which as soon as is executed, connects to one of those remote databases ( As per user requests) through database link and retrieves the required info.
    I know there must be different ways to implement this. But looking for some easy to maintain/administer method. This probably involves adding new tnsnames entry /creating db link … not sure how automated it could be …
    Could you please suggest what you think might be appropriate solution?
    Thanks for the suggestion
    Ali

    Hi,
    Using "Where-used" function, I found that the nodes are stored in T549B table and some FM you could use might be
    CATT_HR_FEATURE_BACKFIELD
    HR_99S_GET_BANK         
    HR_BUILD_FEATURE_TREE   
    HR_ES_FEATURE_BACKFIELD 
    HR_FEATURE_BACKFIELD    
    HR_FEATURE_BACKTABLE    
    HR_WTT_GET_F4_FOR_FEATURE
    HR_WTT_READ_FEATURE_MODDE
    Other tables relate to "Feature" are T549BT, T549C, T549CT, T549D, T588O, T72F1, and T72FA.
    Regards,
    Teddy

  • SQL function to retrieve records only if all the values are available.

    Hi,
    I have a sales table on which i run a parameterized query.
    We pass a few week IDs to retrieve store sales.
    I need to retrieve only those stores that has sales in all the week IDs passed.
    If i use the in operator, i am getting the store data even if there is sales for only one week.
    Is there a function in oracle to do this?
    Thanks,
    Sharan.

    Hi, Sharan,
    Here's how you could use the analytic COUNT function:
    WITH     got_week_cnt     AS
         select  week_id, store_id, prod_desc, sales_units_raw, sales_value_raw
         ,     COUNT (DISTINCT week_id) OVER (PARTITION BY  store_id)            AS week_cnt
         from     sales_store_dwh
         where      week_id in (&&Week_ID_CSV)
    select  week_id, store_id, prod_desc, sales_units_raw, sales_value_raw
    FROM     got_week_cnt
    WHERE     week_cnt  = 1 + LENGTH ('&&Week_ID_CSV')
                    - LENGTH (REPLACE ('&&Week_ID_CSV', ','))
    ;Notice that the sub-query got_week_cnt is just your original query, with the COUNT function added.
    You didn't post your tables or results, so I can't test it.
    You didn't say what version you're using, so I made a conservative guess (Oracle 9 or higher). In Oracle 11, there's a simpler way to find the number of weeks passed.

  • Function to get Family Member Details and Addresses

    Family Member details are stored in pa0021 and their addresses are stored in pa0106.  I can find lots of BAPI's/Functions to read and create new Family Member details, but nothing that deals with both their Details and Address Information (pa0021 and pa0106).  Is anyone aware of some type of function that exists to read/create/change this information?

    Hi Janice,
    perhaps you could user
    BAPI_FAMILYUS_GETDETAIL
    Regards Bernd
    Ps. i haven't uses thsi so far because in germany infotyp 106 is not "allowed" in standard systems.
    Regards Bernd

Maybe you are looking for

  • ITunes 8.0 will not acknowledge the library on a new pc

    I just purchased a new pc and loaded iTunes 8.0. Previously I had my library on an external hard drive. When I open the settings to iTunes and point the location to the external hard drive, iTunes does not acknowledge or open the library. I went as f

  • How do I resize my Lion startup partition?

    Hi there, I just upgraded from Snow Leopard to Lion by partitioning my drive and clean installing Lion on a blank partition. I copied most of my documents from the Snow Leopard partition onto an external hard drive to free up some space for the Lion

  • Document/literal web service with WSDL

    Hi I is so hard to get an easily written example of how to do a Document/literal web service in java, to generate a WSDL descripbing it and then deploying it on Apache. I first belived that I should use JAXM. But I think it is just SOAP and there is

  • Reading TIFF, Writing JPEG with Advanced Imaging

    I am working on a servlet that will read a TIFF image file from a SOCKET connection, and write it to a JPEG file for viewing by the user. I've been able to read the TIFF file into a byte array, but I'm not sure how to write it back out as a JPEG. The

  • HP 2311x monitor not seen by OSX unless the monitor is off/has no power

    I have hooked my Macbook pro up to TV's in the past without issue, I'm now trying to hook it to my HP 2311x monitor.  When the monitor goes to sleep, or I unplug the power the Mac screen will flicker like it does when I first hook up HDMI and then I