LookML Flashcards
(186 cards)
What are the three types of files a LookML Project contains?
- Models
- Views
- LookML dashboards
In what file type are “Explores” defined.
Models
What 5 types of fields can a view contain
- Dimensions
- Measures
- Parameters
- Filters
- Field Sets
Describe the difference between an “object” and a “file”
A file ends with .lkml or .lookml
An object is something defined with code (e.g., “view: foo {}”
There are object models? T / F
False. There are only model files, unlike views, which can be a file or an object.
Should an include refer to the object name or the file name?
File name. E.g., “include: /views/your_mommas.view.lkml”
Is every file in Looker completely separate from the files?
Yes
Are there cases where it’s acceptable to have a view not match the file name?
Yes. For example, if we want to include a group of files, we may include the group name. E.g.,
view_name = "bobs" view_file_name = "people.bobs.view.lkml"
What happens if you include a model inside another model?
The LookML validator will throw an error about the connection being defined twice.
What are the two things “Explore” refers to in Looker?
- An “explore” is a LookML object that lives inside a model file. E.g., “explore: bobs_burgers {}”
- An “explore” is an interactive page where the standard user can SQL queries by clicking on fields in the UI.
What is the reason you don’t want to make your explore (object) contain too many views? What is the reason you don’t want to break explores apart too much? (too few views)
The user will be overwhelmed by the number of fields and options inside an Explore.
If you make Explores for every view, the user will be overwhelmed knowing what Explore to choose.
Balance.
Should you join a view you -think- you may need?
No. Only join what you will use. This saves clutter in the UI.
What is the difference between a “model” and “project”?
Models are LookML files that contain Explores Projects are collections of LookML files. A Project “owns” a model.
Can a project contain multiple models?
Yes.
Is the following valid SQL for a measure?
${orders.total} + ${bakesales.total}
Assuming both of these fields are measures of type: sum.
Yes. If the measure wrapping them is type: number. This tells Looker to add these fields, but not to aggregate them (i.e., not include the field in the GROUP BY).
If you add a measure as a filter and set it to > 0, what appears in the SQL to fulfill the filter?
Something like,
HAVING field_name > 0
When you make a change in development mode, what other users can see this change?
None. Unless they sudo you.
If you change the “Project Settings” in development mode, which users are impacted?
All users. The “Project Settings” impact the entire project–not just your development branch.
Is “Production Mode” LookML read-only? T / F
True.
What happens if you have a view which extends another view, neither view has an sql_table_name defined?
The LookML parser assumes the table name matches the view name. If it does not, it will through a DB error.
dimension: view:, type:, sql: are all examples of what?
LookML parameters.
The ${} is referred to as what?
Substitution syntax. It replaces anything inside ${} with a corresponding object.
What is the purpose of using substitution syntax?
Reduces the number of changes which need to be made throughout a model.
Why is it important to use the substitution operator? I.e., ${}?
- It makes LookML code more reusable.
- It simplifies code maintenance.
- It removes the need for the same SQL code to be written multiple places (DRY).