Maximo Open Forum

 View Only
  • 1.  Query work orders by person group

    Posted 07-03-2024 11:17

    I'm trying to create a query to view all open work orders by each individual part of a person group. Is there a way to do so? I basically want to see all work orders that everyone within a specific person group has open. They could be work orders with various work groups. I would then view by WO owner in a portlet on my dashboard.


    #WorkManagement

    ------------------------------
    Genevieve Ahern
    AbbVie, Inc.
    ------------------------------


  • 2.  RE: Query work orders by person group

    Posted 07-03-2024 11:37

    Hi Genevieve,

    Unless I'm mistaken, you've answered your own question.

    A work group is a collection of people; therefore, you only need to query the work group.

    Maybe you asking "show me all the work orders for person X based on the work groups that they belong to.  For example: Person X belongs to person groups A, C, and E.  You are looking at

    "where persongroup in (select persongroup from PERSONGROUPTEAM where PERSONGROUPTEAM.RESPPARTYGROUP = Person X)"

     



    ------------------------------
    Craig Kokay
    Principal Consultant
    COSOL

    email: craig.kokay@cosol.global
    #IBMChampion
    ------------------------------



  • 3.  RE: Query work orders by person group

    Posted 07-04-2024 10:48

    If you want to make the query generic so it can be used by anyone (perhaps on a Start Center) change "Person x" to ":USER" and it will provide the Work Orders for the person who is logged in…

    [Slight change if you use "ownergroup"]...

    "where ownergroup in (select persongroup from PERSONGROUPTEAM where PERSONGROUPTEAM.RESPPARTYGROUP = :USER)"



    ------------------------------
    Nikolaus Despain CRL
    Aquitas Solutions
    ------------------------------



  • 4.  RE: Query work orders by person group

    Posted 07-04-2024 11:19

    And, if your login and person id are different, then it will be a little more complicated, but it still works:

    (ownergroup in
      (select persongroup from persongroup where persongroup in
        (select persongroup from persongroupteam where respparty in
          (select personid from person where personid =
            (select personid from maxuser where userid =  :USER  )))))
    Here is a full where clause against MAXDEMO as an example, which looks for non-task / non-historical work orders where the logged in user is in the assigned person group (work group) or owner group:
    ((woclass = 'WORKORDER' or woclass = 'ACTIVITY') and historyflag = 0 and istask = 0 and siteid = 'BEDFORD')
     
    and
     
    (ownergroup in (select persongroup from persongroup where persongroup in (select persongroup from persongroupteam where respparty in (select personid from person where personid = (select personid from maxuser where userid =  :USER  ))))
     
    or
     
    persongroup in (select persongroup from persongroup where persongroup in (select persongroup from persongroupteam where respparty in (select personid from person where personid = (select personid from maxuser where userid =  :USER  )))))


    ------------------------------
    Christopher Winston
    Projetech Inc.
    IBM Champion 2024
    ------------------------------



  • 5.  RE: Query work orders by person group

    Posted 07-03-2024 13:54

    As Craig says, you have pretty much gotten to the answer. For whatever reason, Maximo comes with the advanced search in work order tracking, WITHOUT the work group. So, if you add it to the advanced search, then you can build your query directly from within the application and that will give you the primary syntax

    This typically makes it much easier, as you can select multiple groups to build your query, or just one group. In this example, the where clause becomes:

    ((woclass = 'WORKORDER' or woclass = 'ACTIVITY') and historyflag = 0 and (persongroup = 'ENG' or persongroup = 'MAINT') and istask = 0 and siteid = 'BEDFORD')

    The SQL syntax Craig provided will help you search for work where a certain personid is a member of a group assigned to the work. 



    ------------------------------
    Christopher Winston
    Projetech Inc.
    IBM Champion 2024
    ------------------------------