I have a question.
>1) For the latest week, if the number of products within the category is the same or more than those in previous week, then show products in the latest week.
Here, does the "number" mean sum of each product or sum of all products in the same category?
I assume it means sum of each product.
Thus my solutions is simple,
- filter the latest two week, in your sample date, this is not necessary for there's only two weeks data in it.
- don't drop week index into the rows, if week index is necessary to be displayed, just show a "fake".
Since we want to show records only for the latest week, the Week Index needs to be filtered to 1. This is a simplified data, but the reason is we want to show additional calculations for latest week in real-life data.