Creating Project in Looker
Applies to: Kyvos Enterprise Kyvos Cloud (SaaS on AWS) Kyvos AWS Marketplace
Kyvos Azure Marketplace Kyvos GCP Marketplace Kyvos Single Node Installation (Kyvos SNI)
In Looker, a project is a collection of files that describe the objects, connections, and user interface elements that will be used to carry out SQL queries for a Looker user. At the most basic level, these files describe how your database tables relate to each other and how Looker should interpret them.
Once you have created a connection between Kyvos and Looker, you need to create a project. When you create a project in Looker, by default, a model file is created. You can provide the connection details in the model file. You will also have to create a view file in which dimensions and measures of the current semantic model must be defined.
This section explains the procedure and steps for creating a project, model, and view file.
Creating a Project
Click the Develop menu, and the following page is displayed to create a New LookML Project.
On the LookML Project page, click New LookML Project.
In the Select Database Connection section,
Select the database connection from the list.
Enter a unique project name.
In the Select Tables section, select the Schemas.
In the Select Primary Keys section, select a primary key for each table.
In the Select Explores to Create section, select the required explorer to create queries.
In the Enter Model Name section, specify a model name. Ensure that if the field is left blank, the connection name will be used as a model name.
Configuring a model for a Project in Looker
After creating a project, you must configure the model (initially, created automatically). Configuring a model is useful as it specifies that a given model name refers to a particular model in a particular project.
Once your project is created, click the Configure button.
On the Edit Model Configuration dialog, modify the configuration details and click Save.
Creating a Model in a Project
The model file specifies a database connection and the set of Explores that use that connection.
To create a model, click the + icon on the top right of the screen and select the Create Model option, as shown in the following figure.
On the model space, enter your code.
Sample code for a model file:
connection: "kyvos_conn" //connection name include: "looker_view.view" //Views to be included in a model explore: looker_view {} // to get the view name to the Explore menu
Creating Views in a Project
A view file generally defines a single view within Looker. A view corresponds to either a single table in your database or a single derived table. The view file specifies a table to query and the fields (dimensions and measures) to include from that table.
Note
You can define the dimension, attributes, and measures here.
To create a view in the project, click the + icon, and select the Create View option.
A new view is created where you can define the structure of the semantic model.
Sample View file code:
view: looker_view { //view name
sql_table_name: LookerTesting.Looker;;//folder and semantic model name in kyvos
dimension: Product_Category { //Defining a dimension
type: string}
}
measure: Shipping_Cost_DCOUNT { //Defining a measure
type: count_distinct
}