LLMs.txt directory

Connect to Looker SQL in Analyst Studio

Supported JDBC drivers and known issues

Driver Driver Release Date Analyst Studio Removal Date

(Recommended) Avatica Looker version 1.24.1

8/6/2024

Avatica Looker version 1.23.4

9/20/2023

For known limitations, see Looker’s documentation.

Connecting to Analyst Studio

You will also need the following to set up the connection in Analyst Studio:

  • Host: The url of your Looker instance (for example, test123.looker.com).

  • Username: The Client ID portion of the Looker API key.

  • Password: The Client Secret portion of the Looker API key.

From the dropdown, select Looker SQL.

Writing Looker SQL queries in Analyst Studio

To write a new Looker SQL query, navigate to the SQL editor and select your Looker Open SQL connection from the database dropdown.

By default, this connection will surface all available schemas (LookML Models) and tables (Explores). To reference a field within your query, use the following syntax:

Note to use backticks around schema, table, and column identifiers. Wrap any LookML measures in the special function AGGREGATE(), whether it is in a SELECT clause, a HAVING clause, or an ORDER BY clause. You cannot use LookML measures in a GROUP BY clause.

SELECT `view.field`
  FROM `model`.`explore`
  LIMIT 10;
SELECT `customers.state`, `customers.city`,
  AGGREGATE(`orders.total_amount`)
FROM `ecommerce`.`orders`
GROUP BY `customers.state`, `customers.city`
HAVING AGGREGATE(`orders.count`) > 10
ORDER BY 3 DESC LIMIT 5;