Using palo.eparent in a specific hierarchy or subset

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Using palo.eparent in a specific hierarchy or subset

    Dear all,

    I want to retrieve a specific parent in my dimension time (built with the time parameters script in the modeller).

    The problem i have is that every element has 17 parents (month, week, month to date, year, fiscal year...), and all base elements were not created at the same time, so the parent hierarchy is not the same for all elements.

    In my example, I want to retriveve the week number for a spectific day.
    If I use Palo.eparent(server,dimension,element, 1) or any other hierarchy number I do not get always the weeek number (sometimes the month, the YTD, the MTD etc...).

    I was thinking to use palo.eparent in a specific subset of elements (the hierarchy with the year-month-week) to get always the desired parent, but I don't get any idea how to do this...

    Any clue to do so ?

    Thanks for your help,
    Nicolas
  • New

    Hey,

    I personally do not like to use many subsets, due to performance lack.

    I think the best way is, to use PALO.ELEMENT_LIST_PARENTS(Server/ Database, Dimension, Element)

    You can simply exploit this formula with some php in Jedox web.

    #################PHP Code###############

    function e_search_parent($server,$dimension,$element,$search_index){
    $arr = application()->palo_element_list_parents($server,$dimension,$element);
    for($i=0;$i<count($arr);$i++){
    if(strpos($arr[$i][0], $search_index) !== false){
    return $arr[$i][0];
    }
    }
    }

    ########################################

    In your spreadsheet then enter in any cell your created php-formula:

    =E_SEARCH_PARENT("localhost/Test","Test_Dimension","Element","Search_String")

    This formula then returns you the first parent of the given elment matching the search string (e.g. "YTD").


    Best
    Gerwin