A rendering based on a hierarchy level group

Hello
I am faced with a request that I would like a report based on the selection of a group hierarchy level.

Here's the situation: I have a table with a 'normal' hierarchy, said the Scott, with his EMPNO and MGR columns EMP table. What I would like to have is a report that gives me the sum of the column group SAL by all members at a given level. So, if I choose the LEVEL = 1, Id like to see the total number if I choose LEVEL = 2, I would like to see the sum of the salary of all employees managed by the respective Manager etc..

I know that there are opportunities to denormalize the table first and try to solve it from there, but I want to know is if everyone is aware of a more generic way to achieve this? I could accept is a limitation hardcoded the number of nested levels, as seems to be very difficult to achieve in SQL.

In the real world scenario, I use only balanced trees, so from this point of view, the reports will be compatible.

Any ideas?

Thanks, Jürgen

http://www.orafaq.com/node/55

analytical functions will answer your questions...

Tags: Database

Similar Questions

  • SQL query for employees, based on a hierarchy of Org

    Hi all

    I need a query for employee information based on the hierarchy of the Org.

    I tried using previous queries in this forum and on the internet, but not closer to.

    Here's the requirement:

    Level1 Level 2 Level 3
    Org Id 81
    102
    103
    104
    111 (parent 104)
    112 (parent 104)
    105

    My requirement is to group employees based on level 2, which should include level 3 employees in the respective level2 parent id.

    Please suggest.

    Query to get hierarchy:
    SELECT
    LPAD(' ',10*(LEVEL-1)) || org.name hierarchy,ose.organization_id_parent,
    org.organization_id
    FROM
    hr_all_organization_units org,
    per_org_structure_elements ose
    WHERE 1=1
    AND org.organization_id = ose.organization_id_child
    AND ose.org_structure_version_id = 61
    --and org.organization_id = 340
    START WITH
    ose.organization_id_parent = 81
    CONNECT BY PRIOR
    ose.organization_id_child = ose.organization_id_parent
    ORDER SIBLINGS BY
    org.location_id,
    ose.organization_id_child 
    
    Required  Columns:
    
    SELECT haou.name, papf.EMPLOYEE_NUMBER, papf.full_name
    FROM 
    per_org_structure_elements ose
    ,hr_all_organization_units haou
    ,per_all_assignments_f paaf
    ,per_all_people_f papf
    WHERE ose.ORGANIZATION_ID_PARENT = 81
    AND ose.ORG_STRUCTURE_VERSION_ID = 61
    AND haou.organization_id = ose.organization_id_child
    --and paaf.organization_id = ose.organization_id_child
    and papf.person_id = paaf.person_id
    and paaf.organization_id = haou.organization_id
    and :P_GIVEN_DATE between papf.effective_start_date and papf.effective_end_date
    and :P_GIVEN_DATE between paaf.effective_start_date and paaf.effective_end_date
    
    
    

    Thank you and best regards,

    Afzal.

    with

    hr_all_organization_units as

    (select 81 organization_id, ' name 81', 'loc_1' any double union location_id

    Select 102, 'name 102', 'loc_1' from dual union all

    Select 103, 'naming 103', 'loc_10' from dual union all.

    Select 104, '104 name', 'loc_5' from dual union all

    105, select 'name 105', 'loc_3' from dual union all

    Select 111, '111 name', 'loc_5' from dual union all

    112, select 'name 112', 'loc_7' from dual

    ),

    per_org_structure_elements as

    (select org_structure_version_id 61, organization_id_parent 81, 102 organization_id_child of all the double union)

    Select 61,81,103 from all the double union

    Select 61,81,104 from all the double union

    Select 61,81,105 from all the double union

    Select 61,104,111 from all the double union

    Select double 61,104,112

    ),

    employees as

    (select 1 emp_id, name 'emp_1', org_id 111 Union double all the)

    Select 2, 'emp_2', 112 double Union all

    Select 3, 'emp_3', 112 double Union all

    Select option 4, 'emp_4', 111 double Union all

    Select 5, 'emp_5', 105 double Union all

    Select 6, 'emp_6', 104 double Union all

    Select 7, "emp_7", 103 double Union all

    Select 8, 'emp_8', 102 double Union all

    Select 9, 'emp_9', 81 of the double

    )

    Select e.name, e.emp_id, o.level_2

    e employees

    left outer join

    (select org.organization_id,regexp_substr(sys_connect_by_path(org.organization_id,'/'). ' / ',' ^ / (\d+)',1,1,'i',1) level_2

    of hr_all_organization_units org,.

    per_org_structure_elements dare

    where ose.org_structure_version_id = 61

    and ose.organization_id_child = org.organization_id

    Start with ose.organization_id_parent = 81

    Connect prior ose.organization_id_child = ose.organization_id_parent

    ) o

    on e.org_id = o.organization_id

    order by emp_id

    EMP_ID NAME LEVEL_2
    1 emp_1 104
    2 emp_2 104
    3 emp_3 104
    4 emp_4 104
    5 emp_5 105
    6 emp_6 104
    7 emp_7 103
    8 emp_8 102
    9 emp_9 -

    Concerning

    Etbin

  • Formatting through properties of hierarchy level - Can you apply to entire column?

    Hi, I'm looking at the functionality of the hierarchy in 11g. I see that in the criteria tab where it is possible to give the dimension of the formats different members based on what level of the hierarchy, they run (using the 'Level of hierarchy properties' dialog box). This formats the lables of appropriate size, but I also want the numbers associated to inherit the same formatting. Is it possible to do this? I wish that all data in the line of a certain level of hierarchy to carry the same format in order to easily distinguish one level on the other. I don't see a ton of value to add this option, if it applies only to this column.


    If this can be done through the properties of a hierarchy level, is there another solution?


    Thank you


    Trevor

    Is not possible. If the number of items at each level is inferior in number, apply conditional formatting manual on the measurement column.

    Thank you

    ~ KKT ~.

  • JavaScript to make the selection of top level group?

    Does anyone know how to select a group of high level by index?

    For example, I have a lot of files with deeply nested groups and I want to select all the illustrations as high-level groups and create a work plan around the visible boundaries of the group.

    I was able to loop through the groupItems from the document, but I can't seem to tell the difference between the higher level groups and subgroups. In other words, the loop works properly, but it is creating a plan to work around the Group of high level and then around each sub-group and each group within this subgroup.

    In the image as an attachment, you can see that there are 5 top-level groups in this document. However, everything else is essentially grouped within these groups. for example, the logo 'Earth' is about 100 + path grouped items. information on the collar are grouped several times in a complex hierarchy as well.

    The obvious solution is to decouple everything and then regroup every piece of shirt in 1 group. Unfortunately, that in itself is a lot more time than to manually create work plans and then the file is not very clean, if never go back inside to change/fix something.

    I guess a way to loop through the subgroups and ignore them if they are in the geometric limits of higher level? But I'm not really sure where to start on this code...

    This is the code that I currently have which creates around each groupItem, work plans, but also around each groupItem in the upper level... it up also a mistake because I think that illustrator can not cope to create work plans that fast? When I run the same script on less complicated work, it works fine.

    var docRef = app.activeDocument;
    var aB = docRef.artboards;
    var gI = docRef.groupItems;
    
    
    for (a = 0; a< gI.length; a++){
        var currentGroup = gI[a];
        currentGroup.selected = true;
        var vB = currentGroup.visibleBounds;
        aB.add(vB);//an Illustrator error occurred: 1346458189 ('MRAP')
    }   
    

    any ideas how to isolate this high-level group and ignore the rest? Thank you people.

    Screen Shot 2015-01-05 at 11.06.17 AM.jpg

    Instead of document.groupItems, try document.layers [0] .groupItems

  • How to create the hierarchy of groups?

    Hello

    In the Grild control Administration guide, chp. 5, the management of the group, there is this description:

    "Usually you can collect all the objectives that you want to manage as a group." If you use the properties of the target (for example, Line of Business or Type of deployment) to operational information about your targets in Enterprise Manager, you can use these properties when creating groups to locate targets. For example, you could search for all databases deployment Type = Production and belonging to the Line of Business "HCM". You can also create a hierarchy of groups and use nested groups. »

    How to create a hierarchical group? No matter what pointer to more detailed documentation or example?

    Thank you.

    Hello

    during the creation of two groups (e.g., Group1 and Group2) you can add group2 as a member of Group1 - from my point of view, a sort of HIERARCHICAL structure.
    But I'm not able to name any additional documentation...

    HTH

  • GPO to map a drive (on xp sp2 and sp3 clients) based until membership in one group does not completely finish the mapping

    Hi all

    When you try to use a GPO to map a drive (on xp sp2 and 3 customers) based up to membership in a group, it is not completely finished

    Have created a GPO called MapDrive

    -Under User Config. > Preferences > Windows settings > card reader

    -Set Action = replace and it to map to \\Servername\share\%username% if the user is a member of the XYZ Group (common tab > Item-Level targeting)

    What is happening, it's that the good player cards\\Servername\share\ of under file which is the user name.

    To get the GPO to work that day

    -Did you have to install the patch installed XP from KB943729for side extensions (CSE) Client

    -J' also put a policy of waiting for connection before login (this fixes a problem of no similar mapping with the home folder that you can set the path in the user account object)

    Any ideas why the drive mapping complete otherwise would not work or have a work around?

    See you soon,.

    Schmills

    ThanksThahaseena M.

    In fact, I found that it was not a problem with what I did, in fact, it worked.

    What I found is when you map a drive via gpo to a subfolder, for example\\servername\share\subfolder

    What is displayed is\\servername\share , but it actually be mapped directly to the subfolder. In the GPO, you can create a label for the drive, so in my case I created a StorageFor_ %username% label, which then displays the user who received the file, which is what I wanted.

    My original mail can still help those who have problems with

    1 folder without mapping entirely

    2. the CST for HP patch is required for the mapping of the readers via GPO.

    See you soon,.

    Philippe

  • How to make a text field to autopopulate based on responses in two groups of option buttons

    I use Adobe Acrobat Pro and am very new to this.

    What I want to achieve:

    I have two sets of radio buttons; a group is the choice of 'Probability' and the other group is the choice of the "Consequence". Based on what the user takes away in these two groups, I want the form to automatically fill the level of risk in another area. For example If the user selects 'Negligible' in the Group result and 'Rare' in the Group of probability; the field entitled risk rating should display the word "Low". If they choose "Negligible" and "almost certain" the domain of the risk rating should show "moderate". Please let me know if you need further information. Thanks in advance.

    You can use something like this code as the custom field of risk assessment calculation script:

    var consequence = this.getField("Consequence").valueAsString;
    var likelihood = this.getField("Likelihood").valueAsString;
    
    if (consequence=="Insignificant" && likelihood=="Rare") event.value = "Low";
    else if (consequence=="Insignificant" && likelihood=="Almost Certain") event.value = "Moderate";
    // etc.
    else event.value = "";
    

    Edit: Small error fixed in code.

  • Shaved measure based on the month level.

    Hello

    I defined a shaved measure at the "level of months."

    I expect to have an aggregate to the month level in the year.

    But there is evidence of aggregation of the month irrelevant year-round. For example in the data of four years, for the month of August, it shows the aggregation of the Aug-2010, 2009, 2008 and 2007.

    How can I get monthly globalization at the month-year level?

    The time dimension and hierarchy are based standard time dimension OWB.

    Thank you

    ~ Ash

    What is the feature of level key column for months in your time dimension?

    It should be of format YYYYMM, but not just mm...

  • Printer mappings based on membership in a group

    Hello! So far, I'm in love with EUM and all the features it offers. I'm testing with it before extend me to users and find one or two things that have been frustrating me.

    One of them is condition together with membership in the group. What I try to do is something quite simple: map printers based on group membership. For some reason, it does not.

    Here is the part of the log:

    2016-06-30 14:38:15.160 [DEBUG] Conditions: condition «Group.xml» value assessment

    2016-06-30 14:38:15.176 [DEBUG] Conditions: check for subscription of the user from the group "Domain\Network_Admins" = false

    2016-06-30 14:38:15.176 [INFO] jump EMU mapping printers due to conditions ("HQ_Sharp_MX_4141_11 - 38 c .xml')

    2016-06-30 14:38:15.176 [DEBUG] jump off mapping printers EMU ('HQ_XEROX_7775_11 - 25A .xml')

    2016-06-30 [DEBUG] 14:38:15.176 jump off the EMU printers mapping ('SHARP MX-4141N - 11 - 15.xml')

    2016-06-30 14:38:15.207 [DEBUG] Conditions: check for the user OR = true ("CN = LastName\, FirstName, OR = Users, OR is OEIM, DC is domain, DC = com' belongs to 'OR = Users, OU = OEIM, DC = domain, DC = com' or one of its descendants")

    2016-06-30 [DEBUG] 14:38:15.207 managed to create printer registry keys.

    2016-06-30 14:38:15.660 [ERROR] error 1726 trying to map printer "\\printserver\SHARP MX-4141N-11-34 H" ("SHARP MX-4141N-11-34 H .xml ')

    So I put two conditions on two separate just printers to test how it works. A group membership does not work even though I'm 100% sure that I am a part of this group! Also, what is strange, is how the ORGANIZATIONAL unit verification works, but the printer error when you try to install it.

    If anyone is curious, my environment is seen Horizon 6.2.2 build-3508079 and UM 9.0. Everyone has access to the print server printers are on is not a permissions problem with, in my opinion. Both printers are set to run once and asynchronously. I have App Volumes also 2.10 and 3 appstacks and writing attached to these machines. Writable is a UIA for the location of the Outlook OST that I used with this awesome video: using VMware App Volumes and environment the User Manager to store the Cache in Microsoft Outlook (.) (OST) - YouTube

    Thanks to anyone who can shed some light on this for me.

    Hi edsoncruz4,

    You can check your infrastructure on network problems (DFs maybe? Error 1726 average remote procedure call failed), also you can check with the command WHOAMI /groupes if your user name is a member of security assigned groups.

    Raymond

  • Join between tables header &amp; detail based on the age and group

    To find the amount of the age and the group in the table of detail based on age & group_id in header?

    Example: Take the seq_id = 1 mind, it has age = 60 & group_id = 23 (23 months).

    In the detail table xx_detail, the age column represents the age of the person (0-65 represents the age 0-65 and so on).

    If the age is null, while the rank indicates the Group (0-12 represents the group between 0-12 months). If the age is not null, then the Group 1, group 2, group 3 that data amounts.

    So now I must get the amount as 240 (like my seq_id header = 1, age = 60, group_id = 23, as it is covered by group age & 13-59 0-65). So I need a SQL to find the exact amount in detail based on the header record. We must go to settings & group_id age and get an amount of detail tables. Can anyone provide input how to achieve this in the most simple.

    1. SQL > select * from v$ version
    2. 2.
    3. BANNER
    4. --------------------------------------------------------------------------------
    5. Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
    6. PL/SQL Release 11.2.0.3.0 - Production
    7. CORE Production 11.2.0.3.0
    8. AMT for Linux: Version 11.2.0.3.0 - Production
    9. NLSRTL Version 11.2.0.3.0 - Production
    10. SQL > xx_header desc ;
    11. Name Null?    Type                                     
    12. ----------------------------------------- -------- ----------------------------
    13. SEQ_ID VARCHAR2 (6)
    14. AGE                                                NUMBER
    15. START_DATE                                         DATE
    16. GROUP_ID NUMBER
    17. SQL > select * from xx_header;
    18. SEQ_ID AGE START_DATE GROUP_ID
    19. ---------------- ------ ------------------        ---------------
    20. 1 60 1 JANUARY 12 23
    21. 2 89 1 JANUARY 12 23
    22. 3 95 1 JANUARY 12 23
    23. SQL > xx_detail desc ;
    24. Name Null                                      
    ?    Type
  • ----------------------------------------- -------- ----------------------------
  • SEQ_ID VARCHAR2 (10)
  • AGE                                                   VARCHAR2(10)
  • GROUP1 VARCHAR2 (10)
  • GROUP2 VARCHAR2 (10)
  • GROUP 3 VARCHAR2 (10)
  • SQL > select * from xx_detail;
  • SEQ_ID AGE GROUP1 GROUP2 GROUP3
  • ---------- ----------           ----------            ----------     ----------
  • 1                                0-12              13-59       60-126
  • 1           0-65               120                 240         300
  • 1 66 - 135 100 80 400
  • Hello

    Is this the same question you asked 3 days ago

    https://forums.Oracle.com/thread/2606197

    ?

    Whether it is or not, validate the information requested in this message, which is also in the FAQS of the Forum:

    https://forums.Oracle.com/message/9362002

    If it's the same question, do not post a new thread.  Mark it as "Answered" immediately and continue in the original thread.

  • TxtCase of loading of FDM (11.1.2.2) members at the account level group HFM

    Hi all


    I am trying to load TxtCase using the FDM Memo field for export to TxtCase in HFM. I followed the instructions and the previous post and took this method for loading TxtCase: https://forums.oracle.com/thread/2412887.

    The application I'm working on that requires TxtCase loading to members account at group level. For these specific accounts, I loaded a value of '0' in the amount field and text data in a text field in the cell to be charged in the Memo field. The script that maps the TxtCase in Memo field works very well, and the validation step not display any errors. However, when their export to HFM we kick out declarant; "Error: data cannot be entered for members at the group level."


    Is it possible that Memo fields can be loaded to group members at the account level without loading quantity data?

    Thanks a lot for your help!

    Best regards

    Aaron

    Don t you can set the DATA PROTECTION section.

    The easiest way is to find the line where the line is written to the file (you have two places where this happens, one for the only period and one for the period range)

    Verify that the amount is not zero, otherwise skip the line.

    Concerning

  • How to see the/say high level group/directory

    So I have a script with the help of this forum to change styles, but the only problem I have still is I don't know how to say or show the top level of a style (so not in a group).

    Here's the code below, basically I just need to know what to put in instead of groupold/group when the style that I want to use is not in a folder/group. Thanks in advance.

    replaceStyle("Old", "H1", "new", "ActiviyH1");
    replaceStyle ("Old", "H2", "new","ActiviyH2")
    
    
    function replaceStyle(GroupOld , find, GroupNew, replace){
        try{
    var myDoc = app.activeDocument;
    importedStyle = myDoc.paragraphStyleGroups.item(GroupOld).paragraphStyles.item(find);
    ApplyStyle = myDoc.paragraphStyleGroups.item(GroupNew).paragraphStyles.item(replac e);
    importedStyle.remove(ApplyStyle);
        }
    catch(e){
        //alert (e)
        }
    }
    
    

    Hello

    Change a function:

    function replaceStyle(GroupOld , find, GroupNew, replace){
        try{
    var myDoc = app.activeDocument,
    importedStyle = myDoc.paragraphStyles.item(find),
    ApplyStyle = myDoc.paragraphStyles.item(replace);
    
    if (GroupOld) importedStyle = myDoc.paragraphStyleGroups.item(GroupOld).paragraphStyles.item(find) ;
    if (GroupNew) ApplyStyle = myDoc.paragraphStyleGroups.item(GroupNew).paragraphStyles.item(replace) ;
    
    importedStyle.remove(ApplyStyle);
        }
    catch(e){
        //alert (e)
        }
    }
    

    You can call it as:

    replaceStyle ("", find "", replace) or

    replaceStyle (0, find, 0, replace) or

    replaceStyle (undefined, find, undefined, replace)

    for higher level styles

    Jarek

  • WebVPN mapping of group policy-based user name not LDAP Group?

    Hi guys,.

    As the title says I'm looking for a way to map users who authenticate via LDAP to the webvpn to a particular group policy.

    The reason why I want to do, is to assign particular cifs on a per user basis. I know that you can map a LDAP group to group policy, but all users are in the same group. (I can't change that fact).

    So I was wondering if there is a way to map a "username", which authenticates via LDAP on group policy?

    Cheers.

    That's maybe what you are looking for:

    http://www.Cisco.com/en/us/products/ps6120/products_configuration_example09186a008089149d.shtml

    It is similar to the use of RADIUS 25 attribute, but for LDAP.  Read it carefully and you should find the solution.

    Please evaluate the useful messages.

  • Resize upper level groups

    Executes a loop on all groups in a document. If the parent group is a layer, and the layer is free then clipping mask and resize. Resize function fails as "error 21 undefined is not an object" on the THIRD group in this example.

    Test_001.EPS - Google Drive

    #target illustrator

    IDoc var = app.activeDocument;

    var IM = idoc.groupItems;

    function meetTheParents (PageItem) {}

    If (PageItem.parent.typename = "Layer") {}

    return 'layer '.

    }

    }

    function isLayerFree (layer) {}

    If (layer.locked == false & & layer.visible == true) {}

    var gpa = layer.parent;

    isLayerFree (gpa);

    Returns true

    } else {}

    return false

    }

    }

    for (j = gi.length - 1; j > = 0; j-) {}

    var Group = gi [j];

    If (iGroup.hidden == false & & iGroup.locked == false) {}

    If (meetTheParents (iGroup) == 'Layer') {}

    If (isLayerFree (iGroup.parent)) {}

    iGroup.selected = true;

    app.executeMenuCommand ("makeMask");

    app.executeMenuCommand ("deselectall");

    iGroup.resize (50,50,true,true,true,true,50,Transformation=Transformation.CENTER);

    Alert (iGroup.TypeName);

    }

    }

    }

    }

    He fails ONCE the clipping for this mask so the for loop works correctly. It resizes correctly the first TWO times the resizing function is written correctly. If I have the command of resizing in comment and uncomment the alert of the type name of the Group he managed, so the identity of the group in question is not a problem.

    ?!?!?!?!?!?

    And it works?

    (function () {}

    var groups = activeDocument.groupItems,

    Group,

    j;

    for (j = 0; j< groups.length;="" j++="" )="">

    Group = Group [j];

    If (iGroup.hidden == false & iGroup.locked == false) {}

    If (meetTheParents (Group) == 'Layer') {}

    If (isLayerFree (iGroup.parent)) {}

    iGroup.selected = true;

    app.executeMenuCommand ("makeMask");

    app.executeMenuCommand ("deselectall");

    iGroup.resize (50, 50, true, true, true, true, 50, Transformation.CENTER);

    }

    }

    }

    }

    function meetTheParents (PageItem) {}

    If (PageItem.parent.typename = "Layer") {}

    return 'layer '.

    }

    }

    function isLayerFree (layer) {}

    If (layer.locked == false & layer.visible == true) {}

    var gpa = layer.parent;

    isLayerFree (gpa);

    Returns true;

    } else {}

    Returns false;

    }

    }

    } ())

  • apply a clipping for each top-level group mask in the document

    Sample file: https://drive.google.com/file/d/0BzEoJSYDhH_WcXhIalFRTk9qOGc/view?usp=sharing

    We can assume:

    Art • grouped on configurations with a line called die.

    • All groups exist on "Layer 1"

    I am a loop in groups and work with groups who has relatives is "layer". I have to loop through all the groups in the document, but when I created the clipping mask creates a new group and live my loop. I am now a loop only in groups of "Layer 1"and moving them to a new layer before the clipping mask. My script is breaking after the Group has been moved to the new layer. I have a bunch of alerts in there for debugging.

    #target Illustrator
    
    
    var idocX = app.activeDocument;
    var li = idocX.layers;
    
    
    function meetTheParents(PageItem){
      if (PageItem.parent.typename = "Layer"){
      return "Layer";
      } else if (PageItem.parent.typename = "GroupItem"){
      return "Group";
      } 
    }
    
    function isLayerFree(layer){
      if (layer.locked == false && layer.visible == true){
      var gpa = layer.parent;
      isLayerFree(gpa);
      return true
      } else {
      return false
      }
    }
    
    
    var trLyr = li.add();
    trLyr.name = "TRASH";
    var l1 = li.getByName('Layer 1');
    for (j = l1.groupItems.length -1; j >= 0; j--) {
      app.executeMenuCommand ('deselectall');
      var iGroup = l1.groupItems[j];
      if (iGroup.hidden==false && iGroup.locked==false) {
      if (meetTheParents(iGroup) == "Layer"){
      if (isLayerFree(iGroup.parent)){
      iGroup.move(trLyr, ElementPlacement.PLACEATBEGINNING);
      // set die variable to die in current selection
      alert ("Group " + j + " moved to trash layer");
      alert ("trash layer path items length = " + trLyr.pathItems.length); // I'm getting '0' here even though I just moved items into it.
      var die = trLyr.pathItems.getByName('proofLine'); // script breaks here
      alert ("Die identified for this group");
    
      die.move(trLyr, ElementPlacement.PLACEATBEGINNING);
      for (a = 0; a < trLyr.pageItems.length; a++){
      var thing = trLyr.pageItems[a];
      if (thing.hidden==false && thing.locked==false){
      thing.selected = true;
      }
      }
      var sel = idocX.selection; // get selection
      alert (sel.length + " items in current selection.");
    
      // make clipped group of die with art inside
      if (sel.length==2) {// continue only if 2 objects are selected
      var igroup = idocX.groupItems.add(); // add a group that will be the clipping mask group
    
      var imask = sel[0]; // the mask is the object on top
      var ipath = sel[1]; // the "drawn object" is at the bottom
    
      var idup = imask.duplicate(); // duplicate the mask, to later get the fill and stroke to apply to the clipping path
    
      ipath.move (igroup, ElementPlacement.PLACEATBEGINNING); // add both path to the group
      imask.move (igroup, ElementPlacement.PLACEATBEGINNING);
    
      imask.clipping = true; // make the mask the clipping path
      igroup.clipped = true; // clip the everything in the group to the clipping mask
    
      if (idup.filled == true){
      imask.fillColor = idup.fillColor; // add fill color, same as the dup
      }
      imask.stroked = true; // stroke the mask
      imask.strokeWidth = idup.strokeWidth; // add stroke width, same as the dup
      imask.strokeColor = idup.strokeColor; // add stroke color, seme as the dup
    
      idup.remove(); // remove the duplicate
      }else { // show this message if other than 2 objects are selected
      alert("Select both, the Mask and the object that needs to be 'inside'.\rThe Mask needs to be the top most object.");
      }
      app.executeMenuCommand ('deselectall');
      igroup.move (l1, ElementPlacement.PLACEATBEGINNING);
      }
      }
      }
    }
    trLyr.remove();
    

    Inside of my plu script that it breaks in silence, in this example script is for me a 'no such item. There should be such an element, I just put there. Once the script completes, the Group has been moved, which means that the named path is right where it should be.

    Let's see if this works:

    #target illustrator
    function test(){
        if(app.documents.length < 1){
            return;
        }
        var doc = app.activeDocument;
        var lr = doc.layers[0];
        for(var i=0; i		   

Maybe you are looking for