Forum Discussion
LPSUCSF
Jan 22, 2020Copper Contributor
Merge 2 datasets by common id field AND 2 dates if they are within 365 days of each other
Hi, I have 2 datasets that I would like to merge together. There is a common id field between the two but I need the two datasets to also align by date. There is no common date field. One dataset...
ChrisMendoza
Jan 22, 2020Iron Contributor
LPSUCSF -
Data > Queries & Connections > Right-Click Edit to see what was done in the Query Editor.
In the Step 'Added Custom' I added IF ELSE logic as:
if Duration.Days([Dataset2.completeddate]-[createddate]) > 365 then null else if Duration.Days([Dataset2.completeddate]-[createddate]) <= 0 then null else Duration.Days([Dataset2.completeddate]-[createddate])Producing:
Then just filtered out NULL.
LPSUCSF
Jan 22, 2020Copper Contributor
ChrisMendoza Hi. I'm not familiar with Power Queries. Could you please provide a link to how you did this? I am unable to follow what you did. I don't see Queries and Connections in my Data tab. I see only Connections. Thank you.
- LPSUCSFJan 22, 2020Copper Contributor
ChrisMendoza I think I finally got it. Will need to do some data clean up. This was definitely faster than by hand.
- ChrisMendozaJan 22, 2020Iron Contributor
LPSUCSF - Looks like it's 'Show Queries' as shown in https://www.youtube.com/watch?v=zjnFKS9iXPs
- LPSUCSFJan 22, 2020Copper Contributor
ChrisMendoza I have Excel 2016
- ChrisMendozaJan 22, 2020Iron Contributor