Query IMPORTRANGE is only pulling the first row of data - google-sheets

=Query(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1ydrIKPJkYdHa3fJk7NYtGkrMZwU1RyPmOfjt037Ekwk/edit?usp=sharing", "ATJ!A:Z"), "SELECT Col2,Col5,Col6,Col8,Col10,Col11,Col12 WHERE Col5 contains 'Cat Wilson' ORDER BY Col2")
this is only giving me the header row, any suggestions? I need a specific name to filter into Col5. Still very new to this so any help is appreciated.

hard to tell from insufficient intel you provided... try:
=QUERY({IMPORTRANGE("1ydrIKPJkYdHa3fJk7NYtGkrMZwU1RyPmOfjt037Ekwk", "ATJ!A:Z")},
"select Col2,Col5,Col6,Col8,Col10,Col11,Col12
where lower(Col5) contains 'cat wilson'
order by Col2 asc", 1)

Related

Google Sheets Query And Importrange Equals Cell D2

I've got two spreadsheets, a primary sheet (that a google form dumps into) and another sheet (aka management sheet) that has shared access to the primary sheet. I'm trying to run the query below to automatically import a serial number based on the hostname in column D of the management sheet.
I can run a simple importrange successfully, so the access permissions are working properly.
=QUERY(IMPORTRANGE("[URLHERE]”, “Form Responses 1!A2:H”), ”Select Col7 where Col5="&$D2))
Any help would be appreciated, thanks in advance!
Jerome
try:
=SINGLE(QUERY({IMPORTRANGE("1pRWLfnYsJhmJFZio_pvny7oO8UCSUxfGhTc78TbwVhw",
"Form Responses 1!A:H")}, "select Col7 where Col5 = '"&D2&"'", )
I figured it out.
=query({IMPORTRANGE("1pRWLfnYsJhmJFZio_pvny7oO8UCSUxfGhTc78TbwVhw", "Form Responses 1!A2:H")}, "Select Col7 where Col5 = '"&D2&"' LIMIT 1",0)
Jerome

Query groupby and count separated values

I would like to create a table in google sheets, listing some elements (in column) and at the same time counting other elements, currently grouped in a string separated by semicolons.
The example is the following:
initial dataset
desired outcome
I have tried some queries but for the moment I have been able only to count the semicolon-separated elements, without being able to group them for "markets".
Any help is greatly appreciated!
Thank you in advance!
try:
=INDEX(QUERY(IFERROR(SPLIT(FLATTEN(source!A2:A&"×"&SPLIT(source!B2:B, ";")), "×")),
"select Col1,count(Col1) where Col2 is not null group by Col1 pivot Col2"))

How to Combine Data when Columns are Different in Google Sheet

I am trying to have a master file that contains data from 3 separate sheets. Each sheets has the same first 5 columns in order but 3 other columns are in different order in the 3 sheets. How can I combine the data when columns are located differently into one master file?
you can rearrange columns in {} array:
=QUERY({
{QA_Assignments_2021!A2:H};
{QA_Group_2021!A2:F, QA_Group_2021!H2:H, QA_Group_2021!G2:G};
{QA_LOMFCU_2021!A2:H}},
"where Col1 is not null")
or you can do it with multiple queries like:
=QUERY(
{QUERY(QA_Assignments_2021!A2:H, "select A,B,C,D,E,G,H,F");
QUERY(QA_Group_2021!A2:H, "select *");
QUERY(QA_LOMFCU_2021!A2:H, "select A,B,C,H,G,E,F,D")},
"where Col1 is not null")
player0 already provided a great idea of how you will solve your issue. If you are doing it right, it should look like the formula below:
=Query({
Query(QA_Assignments_2021!A2:AB, "select A,B,C,D,E,F,I,N,H");
Query(QA_Group_2021!A2:AB, "select A,B,C,D,E,F,T,L,R");
Query(QA_LOMFCU_2021!A2:AB, "select A,B,C,D,E,F,Y,H,S")
}, "where Col1 is not null")
Output:
Note:
The three A2:AB can be simplified into A2:N, A2:T and A2:Y respectively since you don't need the columns beyond that. But either of the two should work. Adjust the ranges and columns to be queried accordingly if needed.

What formula can be used to find unique value in two data in google sheet?

I am trying to find two unique names in two data. Could you kindly advise what formula can be used? Thank you so much
https://docs.google.com/spreadsheets/d/1lkLSmrbln3ZIZSIe25A48nH6931LzQ8DnLmfI_3jsMQ/edit?usp=sharing
try:
=QUERY(QUERY(FLATTEN(A2:B),
"select Col1,count(Col1) where Col1 is not null group by Col1"),
"select Col1 where Col2 = 1")

Google Sheets IMPORTRANGE and QUERY

I'm new to Sheets and the query function as of last night, so don't know the terminology etc - sorry!
I have two workbooks, a master and a template. I need the templete to pull specific data from the master when Col2 matches a particular number. I have it working great if i manually input the number, but don't want to have to do this everytime I give a copy of the template to a new job. This number in Col2 is unique to each of the templates I give to a new job, and the number will already be manually input into cell J16 of the template. I want the code to pull the number from J16 and search rather than me telling it what the number is everytime. The code I have that works with the manual input number, in this case 4032 is below. Thanks in advance for any help.
Vince.
=QUERY(IMPORTRANGE("1yTp3SajbKovHf_Wjx7CHO9FsIPeQGvmdMytQIkr9gog","Invoices"),"select Col1, Col5, Col11 where Col2 = 4032")
Do you want to get the number (any) from J16 into your query?
Use:
=QUERY(IMPORTRANGE("file_id","Invoices"),"select Col1, Col5, Col11 where Col2 = " & J16)
or better:
=QUERY(IMPORTRANGE("file_id","Invoices"),a1)
where a1 is:
="select Col1, Col5, Col11 where Col2 = " & J16

Resources