简体   繁体   中英

Query Merge & Importrange

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 Sheet I want to have data pulled from Sheet but only the rows,

  • Status
  • Palett ID
  • ItemDesc
  • Asin
  • EAN
  • Units
  • Unitcost
  • Total Cost

This will help me to create a full article list, from what is in each Pallet

Thank you

use:

=INDEX(IFNA(VLOOKUP(A2:A, 
 {IMPORTRANGE("14BJcO6IzT4t4ioryXivFqSEljTDPukmxTaqKV6z10U0", "Pallets Total!B:B"), 
  IMPORTRANGE("14BJcO6IzT4t4ioryXivFqSEljTDPukmxTaqKV6z10U0", "Pallets Total!A:Q")}, 
 {2, 3, 7, 8, 9, 16, 17, 18}, 0)))

在此处输入图像描述


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)

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM