Search code examples
pie-chartstatusmaximo

Pie chart for two special cases in result set with maximo 7.5


I am working with the Maximo version 7.5. I want to display a result set on the start center in pie chart that contains closed Un-Planned WOs which statuses are cancelled (completed/close) vs created Un-Planned WOs which statuses are not cancelled. How can I use the result set to get only these two cases but not all statuses?

Query for closed Un-Planned WOs:

(
  (status = 'CLOSE' or status = 'COMPLETED')
  and (woclass = 'WORKORDER' or woclass = 'ACTIVITY')
  and historyflag = 0
  and istask = 0 
  and siteid = 'SPCSITE'
  and upper(exedepartment) = 'ELECT' 
  and (worktype != 'PM' or worktype != 'PMCAL')
)
and (
  exists (
    select 1 from dbo.locations
    where ((upper(division) = 'ETH'))
      and (
        location = workorder.location
        and siteid=workorder.siteid
      )
  )
)

Query for created Un-Planned WOs:

(
  (status != 'CAN')
  and (woclass = 'WORKORDER' or woclass = 'ACTIVITY')
  and historyflag = 0
  and istask = 0 
  and siteid = 'SPCSITE'
  and upper(exedepartment) = 'ELECT'
  and (worktype != 'PM' or worktype != 'PMCAL')
)
and (
  exists (
    select 1 from dbo.locations 
    where ((upper(division) = 'ETH'))
      and (
        location = workorder.location 
        and siteid=workorder.siteid
      )
  )
 )

Solution

  • I don't have time to try it, but I would create an ALN domain with the two statuses you want to show, create a relationshiop from workorder to your domain that will find the right value based on your criteria, then add to or create a Report Object Structure that includes ALNDOMAIN via your relationship. After all that, you may be able to use that related value for the attribute to base the graph on.

    If that doesn't work, it's probably because the attribute to graph on has to be local (i.e. on WORKORDER). In that case, you'll need to add an attribute to WORKORDER and manage it via an escalation or autoscript.

    But your query has problems in it, too. The history flag will be set (historyflag=1) when the status is CLOSE or CAN. It may also be set when the status is COMP, depending on your Organization > Work Order Options.