Forum

Check for overlappi...
 
Notifications
Clear all

Check for overlapping dates in their position of trust for each member

7 Posts
3 Users
0 Reactions
105 Views
(@danwi)
Posts: 4
Active Member
Topic starter
 
We are getting a new membership system at my work and needs to wash the data we are converting, and there Power Query is were helpful.
 
A member can have had several "positions of trust" with a start and end date. But the old system did not check for overlap between the dates on their different "positions of trust".
I need for each member to test if there is a overlap in the dates and check that "Date To" is larger than "Date from" in each "Position of trust".
I have enclosed a excampel file with the following columns Membernumber, Position of trust, Date From and Date To. in the area A5:D50
I have mark some of the fields, that shoud give overlap.
I have loaded the data in to Power Query where I have grouped the Membernumber, made an index to get how many positions of trust a member has has had. Then I normalized the Dato From an Date To columns.
But how can I make the controls of overlapping dates i Power query ?
 
(I made the check with if formels in the original file, but it makes my file so havy and slow)
 
 
Posted : 17/08/2021 3:51 am
Anders Sehlstedt
(@sehlsan)
Posts: 971
Prominent Member
 

Hello Dan,

Sorry, no file attached. You need to click the Start Upload button after you have added the file.

Br,
Anders

 
Posted : 17/08/2021 5:23 am
(@danwi)
Posts: 4
Active Member
Topic starter
 
We are getting a new membership system at my work and needs to wash the data we are converting, and there Power Query is were helpful.
 
A member can have had several "positions of trust" with a start and end date. But the old system did not check for overlap between the dates on their different "positions of trust".
I need for each member to test if there is a overlap in the dates and check that "Date To" is larger than "Date from" in each "Position of trust".
I have enclosed a excampel file with the following columns Membernumber, Position of trust, Date From and Date To. in the area A5:D50
I have mark some of the fields, that shoud give overlap.
I have loaded the data in to Power Query where I have grouped the Membernumber, made an index to get how many positions of trust a member has has had. Then I normalized the Dato From an Date To columns.
But how can I make the controls of overlapping dates i Power query ?
 
(I made the check with if formels in the original file, but it makes my file so havy and slow)

 

I try to upload the file again

 
Posted : 19/08/2021 1:39 am
Anders Sehlstedt
(@sehlsan)
Posts: 971
Prominent Member
 

Hello Dan,

I am not skilled enough in Power Query to look for a solution using that tool, I have instead looked into highlighting the overlapping dates using conditional formatting, see attached file for an example.

The cells previously highlighted in red are now coloured in light gold, except cell C16, but based on other rows with similar scenario where To and From date are the same but not highlighted by you I assume this can be skipped.

The formulaes in the conditional formatting rules only checks the above or below rows, so if it is needed to be checked in a larger scale then this needs to be adjusted, for such perhaps a solution needs to be found using Power Query.

I hope it gives some help.

Br,
Anders

 
Posted : 19/08/2021 4:26 pm
(@catalinb)
Posts: 1937
Member Admin
 

Hi Dan,

Can you clarify the following case? You have highlighted in red below an overlapping:

10000206 Østerhåbskolen afd. Torsted 1/12/1994 8/03/1999
10000206 Egebjergskolen 9/03/1999 1/04/2003
10000206 Egebjergskolen 1/02/2003 1/04/2003
10000206 Egebjergskolen 1/01/2008 1/10/2014
10000206 Samsø Skole 1/10/2014 31/01/2015
10000206 Samsø Skole 1/02/2015 31/12/9999

You mentioned that:

If a member has more than one "Position of trust" I need to check if the next "Position of trust" has a "Date from" that i larger or equal to the "Date To" in the earlier "position of trust"

What you have highlighted does not follow your description: the overlapping is between the SAME position of trust, not earlier position of trust.

 
Posted : 20/08/2021 1:15 am
(@danwi)
Posts: 4
Active Member
Topic starter
 

Hi Catalin

I Can ser what you mean. In the test file I didn’t put all the fields in the list, and the is some other fields that is different. I should have taken that one to. It was therefore I made the index so I could see which separate the different positions.

 
Posted : 20/08/2021 3:04 pm
(@danwi)
Posts: 4
Active Member
Topic starter
 

Hello Anders

I am not by by laptop this evening, but will look in to your suggestion tomorrow.

 
Posted : 20/08/2021 3:07 pm
Share: