Forum Discussion

BlueBird's avatar
BlueBird
Frequent Visitor
2 years ago
Solved

Counting consecutive dates

Need to count consecutive dates between a date range per person. the columns are: signature date, admit date, discharge date, person id. want to count consecutive signature dates between admit date a...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi BlueBird ,

     

    I tried creating the sample data based on your description.

    Here's my solution.

    1.Group by person id column.

    Select All Rows.

    2.Add an index column.

    3.Expand it.

    4.And the index column is counting consecutive dates. You can rename it.

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.