I have a recurring dataset which consists of two lists of document counts by source and date. I need to compare the totals and identify any discrepancies. A pivot table works well for this purpose when the sources and dates match. However, the dataset does not include zero values – if a given source and date has no documents, that row is not included. This results in the two lists being of unequal column length and the pivot table fails to compare the correct rows.
How can I programmatically compare equivalent rows, and either add in zero rows to keep the column lengths the same or otherwise ensure that all rows are properly lined up?
I tried to iterate over the column and add blank entries as needed. However, because there is no programmatic way that I can think to tell which of the two lists is missing a row when the sources and dates aren’t the same, I have not been able to consistently insert the zero entry in the right list and location.
BaldursLogicGate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
5