Customize Looker
Customize Looker
Both the SQL behind the analytics model and the Qubit Looker block are designed to be amended, extended, or customized by clients or Qubit partners.
As part of model release cycle, Qubit may roll out new extensions. To prevent any changes from being overwritten, you should ensure that any Looker customizations are made in the v01 files, or in a new file.
The following use cases are listed in order of complexity, and are intended to be followed by clients or partners looking to customize the base content.
Adding a new field to the LookML model
Use cases:
-
You require extra measures or dimensions in a model. For example, measures calculated using specific conditions such as counting visitors who have seen details pages only but exclude listing visitors, etc
-
You find yourself creating the same custom calculation over and over again. It would make more sense to add this as a permanent field
Pre-requisites: Field can be derived from existing measures and/or dimensions
Step 1
Identify the subject area you need to customize and which LookML file it it is linked to.
To do this, select next to the field name in the required subject area:

Step 2
Enable Development Mode
by selecting Develop from the menu bar and then select ON to turn the feature.
Locate the customizable file.
There are 2 LookML files per each subject area:

-
A base file containing the default Qubit fields, such as
q_view
. Avoid editing this file. If you do, you’ll have merge conflicts with the next release of the model. -
A customizable file that does not have the suffix. This is where your changes should go. Example name: qview_v01_
|
Leading-practice
The link you selected might have taken you to either of the above files. If it has taken you to the base file, you’ll need to switch to the customizable file, which is likely displayed directly above the base file in the directory. |
Adding a new field to the LookML model, via SQL
Use case:
-
A new field is required that requires a SQL calculation. For example, adding a window function or creating a new column entirely
The new SQL statement should select *
and then additionally the new columns you want to add.
Adding a new table to the LookML model
Use case:
-
You want to bring in an entirely new table. The new table must have at least one field in common with the
view
model table so it can be joined
Pre-requisites:
-
Understand the relationship between
view
and your new data source -
You must ensure that the primary key is properly defined and enforced. Normally, this means that you need to perform deduplication on the table so that there is at least one column to uniquely identify a row
|
Note
This means the distinct count of values in the primary key column must be equal to the total number of rows. |
Step 2
Enable Development Mode by selecting Develop from the menu bar and then select ON to turn the feature. Now create a new LookML view

Step 3
Enter a name for your view
Find your model
file with name (usually model_v01
), and identify the part that represents an existing explore.
Add a join for the new table to the existing explore.
You can do that using following template:
join: new_table {
view_label: "New table"
foreign_key: view_v01.view_id
relationship: one_to_many
}
Joining a new table with an existing LookML view
Use case:
-
You wish to join in data from BigQuery into your Looker views, such as joining CRM data into the model using an email address or User Id.