I have sets of data that I want to combine, but they must output to the same data weeks, and missing data should have nulls inserted. I am not particularly clever with SQL but I think I can explain it.
So I have dates, sales and products from the start of the year (just imagine there are many products):
Date | Sales |
---|---|
02-Jan-2021 | |
09-Jan-2021 | |
16-Jan-2021 | |
23-Jan-2021 | |
30-Jan-2021 | |
06-Feb-2021 | 2 |
13-Feb-2021 | 3 |
20-Feb-2021 | 5 |
27-Feb-2021 | 3 |
06-Mar-2021 | 2 |
13-Mar-2021 | 1 |
20-Mar-2021 | 0 |
27-Mar-2021 | 2 |
I want my =Query
to output the whole time data set, even if there are only limited data (as shown in the table above). My data will overall contain all the weeks, but each product might only start in the middle or might end once sold out. But I want my query to always return a full date range. In Access I would right join my weeks to my sales data weeks, and it would add in all the weeks with nulls.
How can I do that in sheets with Query (or other methods that hopefully doesn't involve a query per week)?