Answer the question
In order to leave comments, you need to log in
How to create an empty string when there is no return data?
There is a QUERY query to several sheets of a table, where each sheet contains data for one month.
Example: =query({ '2020/01'!A1:F99; '2020/02'!A1:F99; '2020/03'!A1:F99}; " SELECT * WHERE (Col1 = "&J1&") ")
If the WHERE condition (search by ID) is met, then the requested data is returned and the table row is filled. All OK.
But in the case when there is no data for the required ID in the sheet / month, then there is nothing to return and the table is built with the skip of this month. How to make it so that if there is no data, the string is still created (empty or with zeros)? I tried to do something with the IF statement, but it didn't work.
Please tell me the solution. If it is not possible to do this within the framework of a QUERY query, then maybe you can come up with an additional construction (formula, additional query for already received data)?
Now it looks like this (2020/02 skipped):
ID | data | Date
21 | 45 | 2020/01
21 | 22 | 2020/03
And it needs to be like this:
ID | data | Date
21 | 45 | 2020/01
21 | 0 | 2020/02
21 | 22 | 2020/03
Answer the question
In order to leave comments, you need to log in
Not the best solution, but you can try if the data structure will not change often
Collect data
Take unique positions
Take unique dates
Build zero records with all possible combinations
Select those that do not exist
Example https://docs.google.com/spreadsheets/d /1kZWMci2QUa...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question