PALO FUNCTION allow to request leaves

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

  • PALO FUNCTION allow to request leaves

    Hello !

    Is there any possibility to request the first leaf of a dimension ? Even if I change the dimension architecture I want to retrieve the name of one of the base element, any of them.
    Is it possible ?
    Hello everyone if you are stuck and you can't post anything on this forum just contact info@jedox.com and request for account activation ! You're welcome !
  • This function doesn' work like I want because when I request =PALO.EPREV("localhost/Demo","Regions","Europe") it return a consolidate element and not a base element. I want to have a way to retrieve base element with the top element or with nothing.
    Hello everyone if you are stuck and you can't post anything on this forum just contact info@jedox.com and request for account activation ! You're welcome !
  • Here's an efficient way to retireve base element and consolidate element from a select element in a dimension :

    PHP Source Code

    1. function base_cons_el($db,$dim,$el)
    2. {
    3. $cons_el = [];
    4. $base_el = [];
    5. $resid = palo_init($_JEDOX['OLAP_HOST'], $_JEDOX['OLAP_PORT'], $_JEDOX['OLAP_SESSION_ID']);
    6. $palo = palo_element_list_descendants($resid, $db, $dim, $el);
    7. $children = array_column($palo,"name");
    8. for($i = 0; $i < sizeof($children); $i++){
    9. if(palo_elevel($resid, $db, $dim, $children[$i]) == 0){
    10. array_push($base_el,$children[$i]);
    11. }else{
    12. array_push($cons_el,$children[$i]);
    13. }
    14. }
    15. $result = array("base" => $base_el, "consolidate" => $cons_el);
    16. return $result;
    17. }
    Display All

    This code allow you to have base element AND consolidate element. Here's an example with the Demo database(so you can test it):
    base_cons_el("Demo","Versions","All Versions");

    It will return only one consolidate element and 7 base element. This example is good because some of base element aren't below the same parent so this example proove that even if there is base element directly below the selected and element and base element below some children of the selected element, all base element will count as base element.

    Edit : We can also use palo_subset to get consolidate/base elements.
    Hello everyone if you are stuck and you can't post anything on this forum just contact info@jedox.com and request for account activation ! You're welcome !

    The post was edited 2 times, last by Zarcoff ().