Forum Discussion
Counting consecutive dates
- Anonymous2 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.
Ok so in that case we really don't need the admit and discharge date. We can just group by the person id and the signature date, and add the GroupKind.Local parameter to your formula, right before the closing parentheses in your Table.GroupBy function. This will group all person ids with contiguous dates. Use the "All Rows" aggregation if you want to keep your other columns, or just use min/ max on the admit/discharge.
--Nate
- BlueBird2 years agoFrequent Visitor
Unfortunately I do need admit and discharge date - -I want to count the consecutive dates - - comparing date to the previous date. admit and discharge date plays a role since someone could have multiple admin and discharge date.