I have a huge data volume table, I need work out the total count number by a pattern.
Sample table fields and records:
Unit_Name Message_Name Time_Of_Message(YY/MM/DD/HH/MM)
Unit_A Message_B 2020-12-01-1:00
Unit_A Message_C 2020-12-01-1:10
Unit_A Message_B 2020-12-01-1:20
Unit_A Message_C 2020-12-01-1:30
Unit_A Message_B 2020-12-01-1:00
Unit_A Message_B 2020-12-01-1:00
Unit_A Message_B 2020-12-01-1:00
Unit_B Message_B 2020-12-01-1:20
Unit_B Message_A 2020-12-01-1:22
Unit_B Message_B 2020-12-01-1:25
Unit_B Message_B 2020-12-05-2:20
Unit_B Message_A 2020-12-05-2:20
Unit_B Message_B 2020-12-05-2:21
...
...
...
My requirements as below:
1. Remove All the records of the Unit_Name if the Unit_Name does not include Message_A(I have sorted data by Unit_Name and Time_of_Message)
For Example, remove all records for Unit_A as above
2. Count the total number and group by Unit_Name for all "Time_of_Message" of "Message_B" is bigger than "Time_of_Message" of "Message_A", and within 5mins
For example, Unit_B: 2
I tried some formulas, but seems doesn't work.
Thanks!