1

I have a Google Sheet, that I am using as a tracker for a game. This was not written by me, just passed down, and I am having a hard time trying to decipher the issue here. As per the title of the question, it gives me the error "Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: Col1" The way it is meant to work, is that there are filter cells to use to filter the list, that is pulled from the other sheets in the worksheet. Any advice would be appreciated.

=QUERY(OC_HISTORY_FILTER(OC_History_Data!B2:L, Members_Unique_Data!A2:B, M9), "SELECT * WHERE "& IF(M7<>"", "Col1>="&M7, "1=1") &" AND " & IF(N7<>"", "Col1<"&(N7 + 1), "1=1") & " AND "& IF(O7<>"","Col2='"&O7&"'","1=1") &" AND "& IF(N9<>"", "Col9='"&N9&"'", "1=1") &" AND "& IF(O9<>"", "Col10='"&O9&"'", "1=1") &" AND "& IF(M11, "1=1","Col5!='Success'") &" AND "& IF(N11, "1=1","Col5!='Fail'") &" ORDER BY Col1 " & IF(O11, "DESC", "ASC") & " LIMIT 500")

3
  • 1
    Perhaps the OC_HISTORY_FILTER() function returns null, undefined or a zero-width of zero-height array? See what it returns if you run it without the query() wrapper. Commented Nov 30, 2023 at 22:20
  • If I remove the query() it just returns a formula parse error instead.
    – Roland410
    Commented Dec 1, 2023 at 23:15
  • I think what @doubleunary is asking you to do is to paste OC_HISTORY_FILTER(OC_History_Data!B2:L, Members_Unique_Data!A2:B, M9) into an empty cell and see what it returns. Simply removing Query won't work.
    – David Tan
    Commented Dec 2, 2023 at 1:41

1 Answer 1

0

The error indicates that query() is not getting a valid data table to process. You cannot fix the error by adjusting the query statement.

The issue is with the OC_HISTORY_FILTER() function or one of its parameters. It is most likely returning a null or undefined value.

To debug the issue, enter this formula in a free cell and see what it returns:

=OC_HISTORY_FILTER(OC_History_Data!B2:L, Members_Unique_Data!A2:B, M9)

To fix the issue, first check the parameters you give in the formula. Look for things like sheet names not matching because of leading or trailing spaces and the like. If the issue is with the code of OC_HISTORY_FILTER(), fix the code.

1
  • Seems like the issue is in the code, with the M9 filter breaking it.
    – Roland410
    Commented Dec 3, 2023 at 20:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.