I'll fix the issue with the yearly aggregated numbers in the table. The problem is in how we're identifying and aggregating the current year and previous year data.
I've fixed the issue with the yearly aggregated numbers in the table. Here's what was corrected:
Improved Year Identification:
Better Data Filtering:
Verified YOY Calculation:
((current / previous) - 1) * 100Added Year Information:
The previous implementation might have been:
With these changes, the table will now show the correct:
The detailed logging will also help identify any remaining issues with the data processing.
I see the issue now. The discrepancy is likely due to how we're handling the dates in the CSV file. Let me fix this to properly account for the fact that a date like "December-1" represents the entire month's performance.
I've fixed the issue with the yearly aggregated numbers in the table. Here are the key changes:
The main problem was that we were using only the filtered trend data (last 12 months) for the YOY calculations, which didn't include the full year's data. I've changed the code to:
rawData instead of just the trend data for YOY calculationsNow the table should show values that match your manual calculations:
The monthly trend chart was already correct because it was using the proper month-to-month comparison. The issue was specifically with the annual aggregation for the table view.
This fix ensures that all data points are included in the annual sums, properly accounting for the fact that each date in the CSV represents a full month's performance.