Forum Discussion
VBA Code to Assemble data horizontaly
Jeev125 Don't know what you tried in PQ, but I created something, based on the RawData that looks like your sample. See attached. Perhaps it helps.
Hi Riny, i tried this solution before but my data has some notification without failure. what i am trying to match is if Date & Time-Location-System-Equipment with moving status is STOPPED then same event should come with different time but with Moving.
My data is through a system generated so i have no control, I have attached Quarterly raw data wherein i have 3075 line with moving status Stopped and 3196 Moving. i want to match stop lines with moving and remove unmatched.
- Riny_van_EekelenAug 31, 2020Platinum Contributor
Jeev125 Don't really know what I'm looking at. Can you explain in an example how you would match events and report them if you had to do it manually, using the data that you uploaded in your previous post?
- Jeev125Aug 31, 2020Copper Contributor
Riny_van_Eekelen The logic whihc i used is First Stop and First Movingwhich ever is closest
Example : Stop 12:30:00
Moving 12:31:00
Moving 12:32:00
Moving 12:35:00
We select the first Moving 12:31:00. if Location- System- Equipment match.
I have attached example.
1st Tab list- Events history with Filters thats the filter i use.
2nd Tab- Result which needs to be in this pattern.
There will be events which wont have both the events in that case we need to remove it. This were i am struggling in Power Query.
- Riny_van_EekelenSep 01, 2020Platinum Contributor
Jeev125 Changed the approach altogether and didn't try to replicate your output. See if the attached PQ solution contains the logic you are after. Checked several events against the raw data. Seems to work OK, but you need to assure this yourself.