I am trying to run multiple queries on a table using Google query.
I have been trying to sparse the dataset using the a,b,c columns using multiple criteria for each column using an AND
combiner.
If one criterion is removed then I want the remaining criteria to be used but as Google query from what I can tell requires an AND
between each match.
If I remove the criteria on one column I also need to remove the AND
depending on which criteria I remove. Is it possible to wrap all my criteria in one AND
request like where AND (a matches 1000, b matches 11, c matches 44)
?
Formula contained in the spreadsheet (refer image below):
"QUERY(
$A$1:$D$7,
""select A,B,C,D
where
""&IF($A$10="""",,""A MATCHES '""&$A$10&""'AND"")&""
""&IF($B$10="""",,""B MATCHES '""&$B$10&""'"")&""
""&IF(AND($A$10<>"""",),,IF(AND(OR($A$10="""",$A$10<>""""),$B$10<>"""",$C$10<>""""),""AND"",)&""
""&IF($C$10="""",,""C MATCHES '""&$C$10&""'"")&""
""))"
Image of the tables:
Here is a link to the file: https://docs.google.com/spreadsheets/d/1MOTLqfLMgtU0F_T6TwjHkTAX2qecwH0FkOFY5ZDEmac/edit?usp=sharing