Hi Ges,
Like Pedro said it's really hard to understand without seeing the query. The query that Pedro posted, I assumed came from you, so unless the OR statement and brackets on your original are set incorrectly, it will work. BTW: I've posted that same query written in more shorthand SQL.
It's important to always include the SITEID in your query as it seems that you've got more than one site and in reality, you only wanted them from the one sited. it's also important to include ISTASK=0 to remove the task work orders, HISTORYFLAG you can remove and you've already stated what statuses you want. That said, IBM have stated that ISTASK and HISTORYFLAG are added in the background by default and so are not needed in the query.
Yes, the relationship that you have mentioned does filter on the WONUM and the SITEID, so that is only about getting info from the work order. The WMASSIGNMENT is a view that uses the following Where Clause
FROM assignment RIGHT OUTER JOIN workorder on assignment.wonum = workorder.wonum and assignment.siteid = workorder.siteidAs you can see, it does not filter out the task, so even though your Work Queries do, the tasks will still show (unless you uncheck "Include Tasks in Scheduler" which is filtered by the code on the Gantt Chart). BTW: If you not assigning people at the task level, there is no need to have tasks displayed. This can be seen as frustrating, but it's a reality that you assigning only at the work order, so no need for tasks.
There should be no way, you should be seeing assignments from another site unless your Work Queries are not filtered.
If the work has a Job Plan, then you can set the Include Tasks in Schedule? to off in the Job Plan, otherwise, yes it's a manual change per work order.
=========================
(status in ('APPR','CONF','HOLD','INPRG','WAPPR','WMATL','WSCH') and (woclass = 'WORKORDER' or woclass = 'ACTIVITY') and upper(crewid) = 'F_F_C' and historyflag = 0 and persongroup = 'F_F_C_1' and istask = 0 and siteid = 'TMMFF' and worktype IN ('CM','H&S','INV','KZN','MBR','MOD','PM','PMD','REQ','STAT','STATD','TRG'))------------------------------
===============================
Craig Kokay,
Lead Senior Maximo/IoT Consultant
ISW
Sydney, NSW, Australia
Ph: 0411-682-040
=================================
#IBMChampion2022
------------------------------
Original Message:
Sent: Fri July 08, 2022 04:02 AM
From: ges purnell
Subject: Graphical Work Week - Unexpected results from Query
Hi All,
I've recently discovered GWW and thought it was ideal solution for the scheduling request from users. I created a new schedule using a simple query to return Outstanding work (status and worktype), but although the query returns the correct work orders it also returns other work orders from different sites, different status's and different worktypes. We found the incorrect work orders were actually tasks of another work order which had the same wonum as one of the correct work orders! I tried restricting these in the query but GWW still returned the incorrect tasks. The work order highlighted below is the correct one, the others are from a different site, different status and dates from the query?

The GWW guide says that work order tasks and those in history will not be included in the results (these are not included when you use the Quick Query Buider).
I also found an IFIX IJ27930 has been released for incorrectly displaying child work orders, but this is showing tasks.
We noticed that if you untick the 'Include Tasks in Scheduler' check box on the work order then this solved the problem, but this does not seem to be a great solution as all workorders by default have this check box ticked, so it means removing this from all existing work orders and changing the default to 0. Also this would mean the tasks would not be shown in Graphical assignment if the work order is used there.
Has anybody else had similar issues or some suggestions in how to solve.
Thanks in advance
Ges
------------------------------
ges purnell
Maximo Administrator
Toyota UK Ltd
Derby
01332 284750
------------------------------
#MaximoScheduler
#Maximo
#AssetandFacilitiesManagement