Forum Discussion

ClemFandango's avatar
ClemFandango
Advocate II
3 years ago

How to calculate continuous dates

Good morning all,

I have an ongoing topic to find gaps in continuous dates, but this is a slightly different problem.

 

For this topic, I am trying to find continuous dates for each ref. Please see example of the data and the columns 'Continuous Start' & 'Continuous End' that I am trying to create. The main difficulty is that some of the start and end dates overlap.

 

If possible, I am also trying to create another column called 'Rank'. The 'Rank' would be an auto generated number that ranks the continuous end dates in decending order i.e the highest rank number would be the MAX continuous end date. There may be about 10+ ranks.

 

Any help eternally appreciated:-

(apologies, I have done both a screenshot and table, because the formatting never works on the table)

 

 

RefStart DateEnd DateContinuous StartContinuous EndRank
12701/01/201831/03/201901//01/201831/03/20201
12701/01/201831/03/201901//01/201831/03/20201
12701/01/201831/03/201901//01/201831/03/20201
12701/01/201831/03/201901//01/201831/03/20201
12701/01/201831/03/201901//01/201831/03/20201
12731/03/201931/03/202001//01/201831/03/20201
12731/03/201931/03/202001//01/201831/03/20201
12731/03/201931/03/202001//01/201831/03/20201
12730/07/202001/09/202130/07/202031/03/20232
12712/08/202001/04/202130/07/202031/03/20232
12731/03/202131/03/202230/07/202031/03/20232
12731/08/202130/11/202230/07/202031/03/20232
12730/11/202107/12/202130/07/202031/03/20232
12731/03/202231/03/202330/07/202031/03/20232
44201/01/201829/09/201901/01/201830/09/20221
44201/01/201829/09/201901/01/201830/09/20221
44201/01/201829/09/201901/01/201830/09/20221
44201/01/201829/09/201901/01/201830/09/20221
44201/01/201829/09/201901/01/201830/09/20221
44201/01/201829/09/201901/01/201830/09/20221
44230/09/201930/09/202001/01/201830/09/20221
44230/09/201930/09/202001/01/201830/09/20221
44230/09/201930/09/202001/01/201830/09/20221
44230/09/201930/09/202001/01/201830/09/20221
44230/09/201930/09/202001/01/201830/09/20221
44230/09/201930/09/202001/01/201830/09/20221
44221/07/202030/08/202101/01/201830/09/20221
44230/09/202030/09/202101/01/201830/09/20221
44230/09/202030/09/202101/01/201830/09/20221
44230/09/202030/09/202101/01/201830/09/20221
44230/09/202030/09/202101/01/201830/09/20221
44202/10/202030/09/202101/01/201830/09/20221
44231/08/202131/08/202201/01/201830/09/20221
44230/09/202130/09/202201/01/201830/09/20221
44230/09/202130/09/202201/01/201830/09/20221
44230/09/202130/09/202201/01/201830/09/20221
44230/09/202130/09/202201/01/201830/09/20221
44230/09/202130/09/202201/01/201830/09/20221
44211/10/202113/10/202101/01/201830/09/20221

2 Replies

  • Hi Mahesh0016 

    The calculated columns 'Continuous Start', 'Continuous End' and 'EndRank' are showing the expected/desired output at this stage. By creating a continuous start date & continuous end date I will be able to identify the date when a 'Ref' is 'New', 'Lost' or 'Returned' and this will be calculated within a date table