Data story: The only sure thing about "Time" is that it changes.
- Vivek Rathod
- Aug 2, 2024
- 1 min read
With "Time" everything changes. Yet, within this change, data analysts hold a silent prayer - that historical "Data" should not change with time as it is backbone of reporting.
For instance, 500 units of sales to end consumer are reported for the past month (May'24). It's similar to "Writing on the wall" a fixed truth etched in time. But what if those numbers shift? If suddenly it's 550 units or 450 units reported for May'24, in next refresh of the report, we face a problem. Possibly few records are duplicated (increase) or few dropped (decrease), leading to discrepancies.
To safeguard against such shifts, SQL logic can be set to compare historical data between recent and previous files. Take May'24 and backward data reported in Jun'24 file and compare it with May'24 file to check:
Any change in number of rows
Any change in columns
Any change in total sum
Any change in data type / format
(Ideally minus SQL query can unveil any change in any cell of the data)
In attached snapshot data for last row is duplicated in Jun'24 file
Follow me on LinkedIn







Comments