kevdragon1
New Member
- Joined
- Mar 8, 2021
- Messages
- 21
- Office Version
- 365
- Platform
- Windows
Hi all,
I have a report that I download every month from a CRM and need to compare it with the report from the previous month.
What I did is I loaded the CURRENT month report in a PQ as a connection and did the same for the PREVIOUS month report. Then I created a Merge Query with a left outer join to compare the first column which is a key used in by the CRM to detect changes. The result is something like this :
My goal is to find out what changed from each column. So what I then did was to create a custom column for each column of the merged table. So I create a custom column for location : Location = Old.Location and Royalty=.Old Royalty :
Here are my questions :
I have a report that I download every month from a CRM and need to compare it with the report from the previous month.
What I did is I loaded the CURRENT month report in a PQ as a connection and did the same for the PREVIOUS month report. Then I created a Merge Query with a left outer join to compare the first column which is a key used in by the CRM to detect changes. The result is something like this :
Key | Location | Royalty | Old.Key | Old.Location | Old.Royalty |
---|---|---|---|---|---|
xy123 | US | 4% | xy123 | US | 5% |
tre456 | US | 4% | tre456 | null | 4% |
fgew532 | Canada | 4% | fgew532 | null | 4% |
My goal is to find out what changed from each column. So what I then did was to create a custom column for each column of the merged table. So I create a custom column for location : Location = Old.Location and Royalty=.Old Royalty :
Key | Compare Location | Compare Royalty |
---|---|---|
xy123 | TRUE | FALSE |
tre456 | FALSE | TRUE |
fgew532 | FALSE | TRUE |
Here are my questions :
- Am I doing this right? I have no idea if this is the best/most efficient way to do it.
- Is there a faster way than creating the comparing columns 1 by 1? Because my real reports have 50+ columns and I don't feel like creating the compare columns 1 by 1.
- Finally, is there a way, once all the comparing has been done, to return the name of the columns that are FALSE for each row? For example, I would like a dashboard where I can see, at a quick glance, that the key fgew532 has 1 FALSE in the Location column. Since I have more than 50 columns it is hard for me to go and check all the time what column was FALSE for each row (because of the merge, I have more than 100 columns in the merged table). When the result is TRUE for a column I want to ignore that column. I only care about the columns with a FALSE.
Thanks
Last edited: