Find the Index in the List

I have a list of dates ,and a formula:

January 1, 2017,January 1, 2020,October 1, 2020,July 1, 2021,January 1, 2023

Sequence(2, thisRow.[List of Effective Dates].count()).FormulaMap(CurrentValue.WithName(i,thisRow.[List of Effective Dates].Nth(i).Year() - thisRow.[List of Effective Dates].Nth(i-1).Year() ))

The concept of the formula is it will get the gap years between the dates. For example

2nd date - 1st date, 3rd date - 2nd date, 4th date - 3rd date, 5th date - 4th date.

So, in my example above the gap years are 3, 0, 1 , 2.
Now I want to find which pair of dates gave 0 gap years.

hi @Alyssa_Gono , I am not sure if this is what you have in mind, let me know what you think of it.

Sequence(1,thisTable.TheDates.Count()).FormulaMap(thisTable.TheDates.Nth(CurrentValue + 1).Year() - thisTable.TheDates.Nth(CurrentValue).Year()).Slice(thisTable.Find(thisRow)).First().WithName(Delta, 

  If(Delta < 0,"",Delta)

)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.