I have been using large dataset for a while now and the important consideration is to keep in mind the products sold for the last 10 years for all of our needs. With the help of this community support, I was able to complete some of the important tasks using this data. I am realizing, however, that there are several products that we don't sell anymore but because we did sell them within last 10 years at some time, we need to incorporate those as well for selected time as long as they fall under last 10 years selling time period.
Here is the link that helped me getting last 10 years worth sales for any given Product Type. Sample example was for 3 years only for concept purpose. What's happening here is that all the calculations are getting performed for Sales that are happening and we are not able to capture some of the products that were sold few years back within last 10 years.
The post you link to does not seems to have the data you are talking about here. I do not see any products with individual sales per year, only "Type" for which there is data for both A and B until 2021.
Please create a reprex with the data that creates the issue. A reprex consists of the minimal code and data needed to recreate the issue/question you're having. You can find instructions how to build and share one here:
Yes @nirgrahamuk ! Problem is same, but scenarios are different.
Here, I would like to extend this existing query where somehow we can consider all "Types" as long as they are sold in last 10 years (3 years for this example) for each date (Year and Month).