Home > Software engineering >  Query Merge & Importrange
Query Merge & Importrange

Time:03-12

I am trying to pull data from one to another sheet, but only specific columns, but it is not working.

=QUERY({ IMPORTRANGE("https://docs.google.com/spreadsheets/d/14BJcO6IzT4t4ioryXivFqSEljTDPukmxTaqKV6z10U0","Pallets Total!A:B"); IMPORTRANGE("https://docs.google.com/spreadsheets/d/14BJcO6IzT4t4ioryXivFqSEljTDPukmxTaqKV6z10U0","Pallets Total!F:H"); IMPORTRANGE("https://docs.google.com/spreadsheets/d/14BJcO6IzT4t4ioryXivFqSEljTDPukmxTaqKV6z10U0","Pallets Total!O:Q") }, "WHERE Col2 = '"&TEXTJOIN("' OR Col2 = '", TRUE, A:A)&"'", 0)

I have tried to just name the different columns in the Importrange or use query itself and name the different col as here:

=QUERY({ IMPORTRANGE("https://docs.google.com/spreadsheets/d/14BJcO6IzT4t4ioryXivFqSEljTDPukmxTaqKV6z10U0!A:Q")}, "WHERE Col2 = '"&TEXTJOIN("' OR Col2 = '", TRUE, A:A), "select Col1, Col2, Col6, Col7, Col8, Col15, Col16, Col17",1)

In summery:

When I put the PalletID in this enter image description here


update:

=QUERY({IMPORTRANGE("14BJcO6IzT4t4ioryXivFqSEljTDPukmxTaqKV6z10U0", "Pallets Total!A:Q")}, 
 "select Col1,Col2,Col6,Col7,Col8,Col15,Col16,Col17 
  where Col2 matches '"&TEXTJOIN("|", 1, A2:A)&"'", 0)

enter image description here

  • Related