Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8129775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:25:58+00:00 2026-06-06T08:25:58+00:00

In the QUERY select clause it states that you can use a scalar function

  • 0

In the QUERY “select” clause it states that you can use a scalar function in place of
a column name, for example “year(A)”.

And in another part of the documentation it states that you can call a script
function by coding “=function_name(…)” into the cell.

My question is: can you use a script function as a “scalar function” in a QUERY
statement?

If possible, it would greatly simplify code and might improve performance,
for some cases, for example “copying data from one sheet to another”.

Here is my example

Assume "test" is a function that issues a "return" statement that modifies
its input parameter.  

I have tried the code

=test(A1)

in a cell and it works.

But when I try this QUERY

=QUERY(A1:A10, "select test(A)" )

it fails. My guess it does not like the “test(A)” value.
Is there some way to do this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T08:25:59+00:00Added an answer on June 6, 2026 at 8:25 am

    My question is: can you use a script function as a “scalar function”
    in a QUERY statement?

    No you can’t, unfortunately.

    Reading between the lines, I think what you would need to do is to modify your script such that it accepts an array as an argument, do what it needs to do over that array, and return a result array. Then you would be able to invoke something like:

    =test(A1:A10)
    

    or you could include that as your first argument in a QUERY statement:

    =QUERY(test(A1:A10);"select Col1 where Col1 contains 'x'")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a query that calls a function in its select clause. The function
How can I write a linq to entities query that includes a having clause?
I have a query which contains in the select clause: d1.id, d1.title, d1.original_doc, d2.id,
In codeigniter framework How I execute a select query with where clause and put
I am not able to run a simple select query with a where clause.
I'm trying to perform a DISTINCT clause on a query like this SELECT DISTINCT
I have a query which contains a select statement in it's where clause. My
I have a query that returns data as XML using the for XML Clause
I have three columns with three values that can be set for each column
I had performed query using Hibernate that refers to single table with where clause.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.