I am relatively new to FME and have been attempting to process data which I would typically do with MapBasic. I have gotten so far but have gotten stuck at the point where I would typically run a loop in MapBasic
When it gets to the point marked ‘ok to here’ The data is sorted and grouped by asset
1. What I’m attempting to do is loop for every asset group i.e. asset 12 in the example below and then for RTC, FCD and NoPumps sum the number in the group
2. Update the row where the count = 1 i.e. RTC = 0 FCD=0 NoPUMPs=2
3. Then discard the remaining lines i.e. 2-7 in the example
i.e.
After repeating for every Asset Group I should then end up with a single line, 10,929, for each Asset, containing the number of Pumps, FCD’s etc
In MapBasic I would simply do this with a few lines of code but can’ replicate with FME.
Select max(asset) from Data into iA
Fetch first from iA
iAssets = iA.Col1
Close Table iA
For iLoop1=1 to iAssets
Select asset, _count, CommonName, sum(RTC),sum(FCD),sum(Pump) from Data where asset=iLoop1 into tTMP
Fetch first from tTMP
iRTC =tTMP.Col4
iFCD =tTMP.Col5
iPump=tTMP.Col6
Close Table tTMP
Select * from Data where asset=iLoop1 and _count=1 into tUpdate
Update tUpdate set RTC = iRTC, FCD = iFCD, Pump = iPump
Close Table tUpdate
Next
I have been pointed in the direction of a workspace runner but don’t see how this would work. Any assistance would be greatly appreciated.
Richard