I’d like to ask. I want to determine the last location of the person’s activity. for example joko. Joko did 7 in & out activities. if joko does activities in & after joko Out, then write OUT in the Last Location column (picture attached). but in the last activity it was seen that Joko had not left the room. then the last activity is not written OUT. I’d like to ask. what activity do I need to use to get the result like below. or do I have to use an Excel formula to get results like the picture? Please help
Try like this
- Read data into datatable dt
- For each row in datatable on dt and assign index variable to index property in for loop
- Use if condition inside
index<dt.RowCount AndAlso currentRow("Person ID").ToString.Equals(dt.Rows(index+1)("Person ID”).ToString) AndAlso currentRow("Activity").ToString.Equals("In") AndAlso dt.Rows(index+1)("Activity”).ToString.Equals("Out")
- On then side use assign activity with
currentRow("Last Location") = "Out"
Hope this helps
Cheers