Create list of date ranges from a list of dates.

drigloff
Posts: 1
Joined: Thu Nov 07, 2019 5:47 am

Create list of date ranges from a list of dates.

Postby drigloff » Thu Nov 07, 2019 5:57 am

Please help me create a function in Power Query.
At one of the steps of the query, as a result, I get a list of dates. Some go sequentially, some separately. The quantity is not fixed.
Example (MM.DD.YYYY):
{01/01/2019, 01/02/2019, 01/03/2019, 01/05/2019, 01/06/2019, 01/08/2019}
I need to determine all intervals of consecutive dates and reflect the list of such intervals. The interval is set by the start and end dates. If there is one continuous date, then it is the beginning and the end.
An example from the previous data:
{{01/01/2019, 01/03/2019}, {01/05/2019, 01/06/2019}, {01/08/2019, 01/08/2019}}.
Please help me write a function to solve this problem.
In my data there are about 10,000 lines, each of which has a list attached up to 365 days. It is desirable that the function works quickly.
It feels like list.generate can help, but I don't understand this function very well.

Return to “Power Query”

Who is online

Users browsing this forum: No registered users and 0 guests

cron