Iteration over a dataset to find a follower ID

analyst
analyst New Altair Community Member
edited November 5 in Community Q&A
Hi all,

I hope you can help me with a hopefully basic question.

I have a dataset with the attributes ID and Timestamp. I would like to set a new attribute with the direct follower of an example. Please compare the example below.

I tried with loops, but could not find out how to do it.

Thank you for any hints.

ID     |     Timestamp     |     Follower ID
1     |     01.01.2014 15:34     |    
2     |     02.01.2014 15:34     |     1
3     |     03.01.2014 15:34     |     2
4     |     04.01.2014 15:34     |     3
5     |     05.01.2014 15:34     |     4
6     |     06.01.2014 15:34     |     5
7     |     07.01.2014 15:34     |     6
8     |     08.01.2014 15:34     |     7
Tagged:

Answers