Feb 17, 2023

Unable to parse query string for Function QUERY parameter 2

I am trying to pull data from a different sheet based on two values:

Essentially, pull data from column W/col23 based on 2 values in column F/col6 (either if it says 'Conversion' or 'Finished - Met bar')

=query(importrange(B1,B2),"select Col23 * where Col6 contains 'Conversion' or 'Finished - Met bar'")

It keeps giving me a parse query error ): 
Locked
This question is locked and replying has been disabled.
Community content may not be verified or up-to-date. Learn more.
Recommended Answer
Feb 21, 2023
Try the following

=query(importrange(B1,B2),"select Col23 where Col6 contains 'Conversion' or Col6 contains 'Finished - Met bar'  ")


I noticed you had an asterisk after Col23

I was not obvious to spot as I was not able to test the formula.

Hopefully it will work now

Ben Liebrand


Original Poster Mdh888 marked this as an answer
Helpful?
Recommended Answer
Feb 21, 2023
Hello,

Usually the * is used to pull "all" data instead of choosing which columns to pull. Try removing the * and see if it works.


James :)
Original Poster Mdh888 marked this as an answer
Helpful?
All Replies (3)
Feb 17, 2023
Hi, Mdh888,


The query would need to be written as follows

=query(importrange(B1,B2),"select Col23 * where Col6 contains 'Conversion' or Col6 contains 'Finished - Met bar'  ")


I hope this helps,

Ben Liebrand
Recommended Answer
Feb 21, 2023
Try the following

=query(importrange(B1,B2),"select Col23 where Col6 contains 'Conversion' or Col6 contains 'Finished - Met bar'  ")


I noticed you had an asterisk after Col23

I was not obvious to spot as I was not able to test the formula.

Hopefully it will work now

Ben Liebrand


Original Poster Mdh888 marked this as an answer
Feb 22, 2023
Hi Ben & James, 

Super helpful, thank you! The * was indeed misplaced here, I realized I am still missing an additional argument though, hoping I can rely on your expertise once more. 

Here is a sample of the original data sheet: https://docs.google.com/spreadsheets/d/1QT6YMKdhCCdUAOeHaiLGBIUAk5CCHsQs-QSLRmKce4k/edit?usp=sharing

What I want to be able to pull is: the unique university data from column W/col23 (sometimes the same university may be in the sheet multiple times) based on 2 values in column F/col6 ('Conversion' or 'Finished - Met bar') only for the rows that contain 2 values from column B/col2 ('BAM' or 'MBA')

So if an intern/row is identified as BAM or MBA in column B/col2 AND the status is Conversion or Finished - Met bar in column F/col6, then I want to be able to pull the university data in column W/col23 


Recommended Answer
Feb 21, 2023
Hello,

Usually the * is used to pull "all" data instead of choosing which columns to pull. Try removing the * and see if it works.


James :)
Original Poster Mdh888 marked this as an answer
Feb 22, 2023
Hi James, I replied to the above comment with a follow up question - would be great to get your insights. And thank you for explaining what the * does, very helpful!
Feb 22, 2023
Hi, Mdh888,

A post should be kept to one question. You are asking a new question. Please create a new question and that way you will keep the thread short and easier for others reading to understand what you were asking and how your question was solved.

You also have a better change of having you question answered.

Thank you,

Ben Liebrand
Last edited Feb 22, 2023
false
15339718558094665716
true
Search Help Center
true
true
true
true
true
35
Search
Clear search
Close search
Main menu
false