Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  Saved query: Parameter via dialog window?

    Posted Mon May 03, 2021 01:06 AM
    Edited by System Admin Wed March 22, 2023 11:56 AM
    MAM 7.6.1.2:

    My organization uses this query for the Anywhere Work Technician WO list:

     

    --select WOs and tasks that are INPRG and that are assigned to me or my crew

               woclass = 'WORKORDER'

           AND worktype <> 'INSP'

           AND status IN (SELECT VALUE

                            FROM maximo.synonymdomain

                           WHERE domainid = 'WOSTATUS' AND maxvalue IN ('INPRG'))

           AND (   (EXISTS

                        (SELECT 1

                           FROM maximo.assignment

                          WHERE     assignment.wonum = workorder.wonum

                                AND siteid = workorder.siteid

                                AND (   laborcode =

                                        (SELECT laborcode

                                           FROM maximo.labor

                                          WHERE personid = :&PERSONID&)

                                     OR laborcode IN

                                            (SELECT laborcode

                                               FROM maximo.amcrewlabor

                                              WHERE amcrew IN

                                                        (SELECT amcrew

                                                           FROM maximo.amcrewlabor

                                                          WHERE laborcode =

                                                                (SELECT laborcode

                                                                   FROM maximo.labor

                                                                  WHERE personid =

                                                                        :&PERSONID&))))))

                OR (wonum IN

                        (SELECT parent

                           FROM maximo.workorder

                          WHERE     woclass = 'ACTIVITY'

                                AND (EXISTS

                                         (SELECT 1

                                            FROM maximo.assignment

                                           WHERE     assignment.wonum =

                                                     workorder.wonum

                                                 AND siteid = workorder.siteid

                                                 AND status IN

                                                         ('ASSIGNED', 'STARTED')

                                                 AND (   laborcode =

                                                         (SELECT laborcode

                                                            FROM maximo.labor

                                                           WHERE personid =

                                                                 :&PERSONID&)

                                                      OR laborcode IN

                                                             (SELECT laborcode

                                                                FROM maximo.amcrewlabor

                                                               WHERE amcrew IN

                                                                         (SELECT amcrew

                                                                            FROM maximo.amcrewlabor

                                                                           WHERE laborcode =

                                                                                 (SELECT laborcode

                                                                                    FROM maximo.labor

                                                                                   WHERE personid =

                                                                                         :&PERSONID&)))))))))


    As a supervisor, I want to be able to "see what my Anywhere users see" to make sure that I've set up their WOs correctly.

    The above Anywhere query is available to me in the WOTRACK list view as a saved query. However, when I run the query, I don't have a way to specify what PERSONID I want to run the query on (it runs on the currently logged in user (me) and that's not what I want).


    For saved queries like this, is there a way to enter a parameter into a dialog window to filter the query?


    RFE / Idea:
    Saved query parameters
    https://ibm-ai-apps.ideas.ibm.com/ideas/MASM-I-548


    #AssetandFacilitiesManagement
    #Maximo


  • 2.  RE: Saved query: Parameter via dialog window?

    Posted Tue May 04, 2021 10:22 AM
    I'm not aware of a way to do this. I would just make a copy of the query with the "parameter" hard-coded. Then, the dialog you would enter the parameter into would be the View/Manage Saved Queries dialog.

    ------------------------------
    Blessings,
    Jason Uppenborn
    Sr. Technical Maximo Consultant
    Ontracks Consulting
    ------------------------------



  • 3.  RE: Saved query: Parameter via dialog window?

    Posted Tue July 20, 2021 01:10 PM
    Edited by System Admin Wed March 22, 2023 11:50 AM


  • 4.  RE: Saved query: Parameter via dialog window?

    Posted Tue May 04, 2021 12:58 PM
    In addition to what Jason recommends you could also create either an ad-hoc report or a new static report and parametrize the person value.  Or you could create an outer report to generate a list of persons who report to you as a supervisor (or any person running the report.). This would provide a list of the persons for whom a subsequent sub report then shows the work orders using this query.

    ------------------------------
    Bradley K. Downing , MBA
    IBM Certified Adv. Deployment Prof. Maximo v7.6.1
    IBM
    Bakersfield CA
    ------------------------------



  • 5.  RE: Saved query: Parameter via dialog window?

    Posted Mon September 27, 2021 09:39 PM
    Edited by System Admin Wed March 22, 2023 11:55 AM
    If a person had an appetite for messy code, then they could put a WITH clause in a subquery, and store a single instance of the PERSONID there.

                   workorderid IN

                   (WITH c AS (SELECT '1234' AS p FROM DUAL)

                    SELECT workorderid

                      FROM maximo.workorder

                     WHERE     woclass = 'WORKORDER'

                           AND worktype <> 'INSP'

                           AND status IN

                                   (SELECT VALUE

                                      FROM maximo.synonymdomain

                                     WHERE     domainid = 'WOSTATUS'

                                           AND maxvalue IN ('INPRG'))

                           AND (   (EXISTS

                                        (SELECT 1

                                           FROM maximo.assignment

                                          WHERE     assignment.wonum =

                                                    workorder.wonum

                                                AND siteid = workorder.siteid

                                                AND (   amcrew IN

                                                            (SELECT amcrew

                                                               FROM maximo.amcrewlabor

                                                              WHERE laborcode =

                                                                    (SELECT laborcode

                                                                       FROM maximo.labor

                                                                      WHERE personid =

                                                                            (SELECT p FROM c)))

                                                     OR laborcode =

                                                        (SELECT laborcode

                                                           FROM maximo.labor

                                                          WHERE personid =

                                                                (SELECT p FROM c))

                                                     OR laborcode IN

                                                            (SELECT laborcode

                                                               FROM maximo.amcrewlabor

                                                              WHERE amcrew IN

                                                                        (SELECT amcrew

                                                                           FROM maximo.amcrewlabor

                                                                          WHERE laborcode =

                                                                                (SELECT laborcode

                                                                                   FROM maximo.labor

                                                                                  WHERE personid =

                                                                                        (SELECT p FROM c)))))))

                                OR (wonum IN

                                        (SELECT parent

                                           FROM maximo.workorder

                                          WHERE     woclass = 'ACTIVITY'

                                                AND (EXISTS

                                                         (SELECT 1

                                                            FROM maximo.assignment

                                                           WHERE     assignment.wonum =

                                                                     workorder.wonum

                                                                 AND siteid =

                                                                     workorder.siteid

                                                                 AND status IN

                                                                         ('ASSIGNED',

                                                                          'STARTED')

                                                                 AND (   amcrew IN

                                                                             (SELECT amcrew

                                                                                FROM maximo.amcrewlabor

                                                                               WHERE laborcode =

                                                                                     (SELECT laborcode

                                                                                        FROM maximo.labor

                                                                                       WHERE personid =

                                                                                             (SELECT p FROM c)))

                                                                      OR laborcode =

                                                                         (SELECT laborcode

                                                                            FROM maximo.labor

                                                                           WHERE personid =

                                                                                 (SELECT p FROM c))

                                                                      OR laborcode IN

                                                                             (SELECT laborcode

                                                                                FROM maximo.amcrewlabor

                                                                               WHERE amcrew IN

                                                                                         (SELECT amcrew

                                                                                            FROM maximo.amcrewlabor

                                                                                           WHERE laborcode =

                                                                                                 (SELECT laborcode

                                                                                                    FROM maximo.labor

                                                                                                   WHERE personid =

                                                                                                         (SELECT p FROM c)))))))))))


    Yikes. There's got to be a better way than this (other than a report -- unfortunately, a report doesn't let me filter the WO list view)

    For the record, I did not write this query.


    #AssetandFacilitiesManagement
    #Maximo


  • 6.  RE: Saved query: Parameter via dialog window?

    Posted Tue September 28, 2021 11:46 AM
    So I looked back at this original post and the objective is to understand what as a Scheduler, (a Planner doesn't care per-se who does the work as long as the correct skill is applied,) a user would see after you have assigned work, correct?

    So it occurs to me that a report is really the only way of seeing this data without having to perform many and multiple queries.  A user/ technician usually has a suprervisor.  So the supervisor would have direct reports and those persons would be made into a sub-report and you would simply input the name of the supervisor to execute the report.  This really is the most efficient way of managing the work effort.  I think the query you have (while it works ) is over thought.  Perhaps not.  perhaps it is the best business solution for you the way you operate.  But to get to the objective you want you would want to break that down into a manageable report, so you could iterate through a list of twenty or fifty or a hundred, or five hundred, or a thousand persons.

    ------------------------------
    Bradley K. Downing , MBA
    Solutions Engineer
    IBM
    Bakersfield CA
    ------------------------------