Home > OS >  Combine query results vertically
Combine query results vertically

Time:06-07

I have these 2 queries that I would like to combine together in one sheet:

Query #1:

=ARRAYFORMULA(QUERY(if(Presentations!G3:G = "Conference presentation", {Presentations!A3:A, Presentations!B3:B, Presentations!C3:C, Presentations!S3:S, Presentations!V3:V, Presentations!K3:K&". "&Presentations!L3:L, Presentations!T3:T}, {Presentations!A3:A, Presentations!B3:B, Presentations!C3:C, Presentations!S3:S, Presentations!V3:V, Presentations!P3:P&". "&Presentations!Q3:Q, Presentations!T3:T}), "select Col1, Col2, Col3, Col4, Col5, Col6, Col7 where Col4 is not null",0))

Query #2:

=ifna(ARRAYFORMULA(QUERY({'Doc Engagement'!A3:A, 'Doc Engagement'!B3:B, 'Doc Engagement'!C3:C, 'Doc Engagement'!S3:S, 'Doc Engagement'!I3:I, 'Doc Engagement'!G3:G&": "&'Doc Engagement'!H3:H, 'Doc Engagement'!T3:T}, "select Col1, Col2, Col3, Col4, Col5, Col6, Col7 where Col6 is not null",0)))

I tried enclosing each query with iferror and putting a ; and {} but none of that worked.

What am I doing wrong?

CodePudding user response:

try:

=ARRAYFORMULA(QUERY({if(Presentations!G3:G = "Conference presentation", {Presentations!A3:A, Presentations!B3:B, Presentations!C3:C, Presentations!S3:S, Presentations!V3:V, Presentations!K3:K&". "&Presentations!L3:L, Presentations!T3:T}, {Presentations!A3:A, Presentations!B3:B, Presentations!C3:C, Presentations!S3:S, Presentations!V3:V, Presentations!P3:P&". "&Presentations!Q3:Q, Presentations!T3:T}); {'Doc Engagement'!A3:A, 'Doc Engagement'!B3:B, 'Doc Engagement'!C3:C, 'Doc Engagement'!S3:S, 'Doc Engagement'!I3:I, 'Doc Engagement'!G3:G&": "&'Doc Engagement'!H3:H, 'Doc Engagement'!T3:T}}, "select Col1, Col2, Col3, Col4, Col5, Col6, Col7 where Col4 is not null",0))

or:

=ARRAYFORMULA({QUERY(if(Presentations!G3:G = "Conference presentation", {Presentations!A3:A, Presentations!B3:B, Presentations!C3:C, Presentations!S3:S, Presentations!V3:V, Presentations!K3:K&". "&Presentations!L3:L, Presentations!T3:T}, {Presentations!A3:A, Presentations!B3:B, Presentations!C3:C, Presentations!S3:S, Presentations!V3:V, Presentations!P3:P&". "&Presentations!Q3:Q, Presentations!T3:T}), "select Col1, Col2, Col3, Col4, Col5, Col6, Col7 where Col4 is not null",0); QUERY({'Doc Engagement'!A3:A, 'Doc Engagement'!B3:B, 'Doc Engagement'!C3:C, 'Doc Engagement'!S3:S, 'Doc Engagement'!I3:I, 'Doc Engagement'!G3:G&": "&'Doc Engagement'!H3:H, 'Doc Engagement'!T3:T}, "select Col1, Col2, Col3, Col4, Col5, Col6, Col7 where Col6 is not null",0)})
  • Related