Answer the question
In order to leave comments, you need to log in
How to combine multiple selects in one Google Query?
Need to find 2 sums in the same column, but with different conditions.
Now it is implemented like this:
Columns A-C are filled through
=QUERY('Sheet6'!A:G;
"Select A, B, sum(F)
Where (C contains 'Fruits' OR C contains 'Fruits')
Group by B, A
LABEL A'', B'', sum(F)''")
A column D
=QUERY('Sheet6'!A:G;
"Select F
Where (B = '"&B2&"')
AND (C contains ' Apples' OR C contains 'Apple')
LABEL F''")
The problem is that the second query needs to be passed through. How to combine these requests:?
Answer the question
In order to leave comments, you need to log in
Without a Table, it's hard to tell exactly what formula you need, but you can start by concatenating the ranges.
=QUERY({
QUERY('Лист6'!A:G;
"Select A, B, sum(F)
Where (C contains 'Фрукты' OR C contains 'Fruits')
Group by B, A
LABEL A'', B'', sum(F)''")
;
QUERY('Лист6'!A:G;
"Select F, '', ''
Where (B = '"&B2&"')
AND (C contains 'Яблоки' OR C contains 'Apple')
LABEL F''")
};"select Col1 where Col1<>''";0)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question