It the "item" is an Asset, then you will find data in the ASSETTRANS object in the DB. Since you know the current asset and the location, you can find the immediate predecessor in the ASSETTRANS object (sorting on
datemoved.) Using DB2 SQL against MAXDEMO DB here is what I believe will get you close to what you want:
with cat (assetnum, datemoved, fromparent, fromloc, toloc) as
(Select fat.assetnum, fat.datemoved, fat.fromparent, fat.fromloc, fat.toloc
from assettrans fat
where fat.toloc = 'BR450'
union all
select tat.assetnum, tat.datemoved, tat.fromparent, tat.fromloc, tat.toloc
from assettrans tat
where tat.fromloc = 'BR450'
)
select * from cat
order by cat.datemoved
You output might look like this then:
I threw this together pretty quick. You may want to play with the
fromloc and
toloc attributes to see what yields the best info (this is not a formal self-join so, the "from" and "to" get kind confusing.) I tested this without actually making any changes (as the dates can attest! Ha!) but I think this is close. If not, I hope it will help you get started down the right road. You could easily use the BIRT reporting capabilities to build a report to allow you to input the location as a parameter.
Hope this helps
------------------------------
Bradley K. Downing , MBA
Solutions Engineer
IBM
Bakersfield CA
------------------------------
Original Message:
Sent: Thu March 17, 2022 09:56 AM
From: Robert Goff
Subject: Tracking Asset Replacement
For a given equipment item, we would like to identify the item that it replaced, which is presumably now either decommissioned or operating in a different location. This seems like a question others might have asked before, but I'm apparently not using the right search terms. Can someone point me in the right direction? Thank you.
------------------------------
Robert Goff
------------------------------
#AssetandFacilitiesManagement
#Maximo