Hi,
I have a large dataset and I'm trying to count the longest streak (consecutive years) for the individual for a specific country and sport.
I have no idea how to approach this so any help will be greatly appreciated.
Thanks in advance.
Example data (streak column shows the expected answer) -
I have a large dataset and I'm trying to count the longest streak (consecutive years) for the individual for a specific country and sport.
I have no idea how to approach this so any help will be greatly appreciated.
Thanks in advance.
Example data (streak column shows the expected answer) -
Year | Country | Sport | Name | streak |
2012 | Australia | Football | Alan | |
2013 | Australia | Football | Alan | |
2014 | Australia | Football | Alan | |
2015 | Australia | Football | Alan | |
2016 | Australia | Football | Alan | |
2017 | Australia | Football | Alan | 6 |
2018 | Australia | Hockey | Alan | |
2019 | Australia | Hockey | Alan | |
2020 | Australia | Hockey | Alan | 3 |
2019 | China | Tennis | Alex | |
2020 | China | Tennis | Alex | 2 |
2008 | Brazil | Hockey | Brian | 1 |
2013 | United Kingdom | Football | John | |
2014 | United Kingdom | Football | John | |
2015 | United Kingdom | Football | John | |
2017 | United Kingdom | Football | John | |
2018 | United Kingdom | Football | John | |
2019 | United Kingdom | Football | John | |
2020 | United Kingdom | Football | John | 4 |
2020 | Australia | Tennis | Daniel | 1 |