On this Page
Docs Menu

Go to View Parameter List

This page refers to the view parameter that defines a view

view can also be used as part of an explore, described here


- view: view_name
    1. the name of a database table
or 2. the desired name when using sql_derived_table
or 3. the desired name when using derived_table


The view parameter, along with its underlying parameters, describes a table of data that will be used in a Looker model. That table can be one that already exists in your database or you can create a new table using Looker’s derived table functionality.

In the case of an existing database table, the name of the view generally matches the name of the table that you want to work with. If you want the view name to be different than the underlying table or if you need to reference a table from a different database or schema, you can add the sql_table_name parameter.

In the case of a derived table, the name of the view can be any identifier. Then references to the derived table use that identifier name.

After you create a view, you must reference that view in an explore or join parameter to make the view available to users.


Make the order table in your database available for modeling:

- view: order

Create a derived_table named user_facts:

- view: user_facts derived_table: sql: …

Make the order_1 table in your database available for modeling, but use the sql_table_name parameter to call it order:

- view: order sql_table_name: order_1

Use the sql_table_name parameter to make the user table from your analytics schema available for modeling:

- view: user sql_table_name: analytics.user

Common Challenges

A view Is Not Accessible By Users Until Added With explore Or join

Creating a view will not do anything in and of itself. In order for users to be able to interact with it the view must be referenced by an explore or join parameter.

Two views Must Be Referred to by Different Names Within an explore

Within any given explore, a view can be used more than once, but each view must have a unique reference. If you need to join a view to an explore more than once, you need to use the from parameter in your join.

Tables Referenced By view Must Be Accessible From The Current Connection

views are referenced by an explore or join parameter, which in turn is referenced by a model. The model determines which database connection is used (see the connection parameter). Database connections themselves are defined in the Admin section of Looker, and they have a default schema associated with them.

When you reference a table in the view parameter, the table needs to be accessible within the associated connection. Additionally, if you need to reference a table from the non-default schema, you’ll need to make use of the sql_table_name parameter to provide the non-default schema name.

Things to Know

view Usually Contains Dimensions and Measures

Although view could theoretically be used all by itself, in practice, it almost always has dimensions and measures nested underneath it. Dimensions provide access to the columns of the database table, while measures allow aggregation of columns.

Dimensions are described here, while measures are described here. In addition, you can define filter fields and groups of date-based dimension fields using dimension groups.

Still have questions?
Go to Discourse - or - Email Support