Thanks for the clarifications and sorry for the confusion.
The SP upgrade shouldn't be an issue.
I am still confused on why replacement path? is it just to get text values?
What is 37 - 36.. is it like current week - last week?
You have mentioned that the logic is validated, may i ask how was that done
Did you debug the query from RSRT tcode? If not, could you please do that and check if you see something odd?
Regards
Karthik