From Sample to Real - 5 Steps for Your First LookML Project

This article will guide users who are new to Looker to accelerate their first LookML project by building from concepts that are available in our sample LookML projects.

Most new Looker instances come with built-in sample content, including sample datasets and models. For users who launched a Looker (Google Cloud core) instance, you may have noticed our fictional e-commerce dataset, named TheLook, and three sample LookML projects, ranging from “basic” to “advanced”.

Sample projects are a great place to get exposed to LookML concepts with a working dataset and model, and to interactively try out making changes and seeing the resulting user experiences. However, it can still feel like a daunting process to transition from a sample to your first real LookML model. These five steps can guide you from start to finish.

Step 1 - Understand LookML concepts

Of course, the first step is to trial the sample projects and their resulting dashboards and Explores. Here is a partial list of some things to try in the sample project:

  • Try the dashboards
  • Try the Explores
  • Create a few test queries
    • How does the field picker work?
    • How is data presented to the user?
    • How do selected fields from the field picker translate to the generated SQL?
  • Correlate entries in the field picker with the associated declarations in the LookML
    • What’s the difference between a dimension and a measure?
    • How do joined tables appear in the field picker?
    • How are fields labeled?
  • Try adjusting the LookML to see how the field picker and/or generated SQL are affected

Step 2 - Hide the sample models, but keep them around for reference

If you’re not yet familiar with the ‘hidden’ parameter in LookML, this is a great opportunity to see its value. By assigning `hidden: yes` to the Explores in the sample LookML, they will no longer appear in the Explore picker, so you can keep them around for reference purposes without inconveniencing your users.

This is also a great time to practice promoting changes from your development environment to production - this will ensure your changes are reflected in what other users see. You can try toggling out of Development Mode to confirm.

Step 3 - Auto-generate LookML for your own datasets

The sample project is great, but to keep things manageable and organized, you’ll want to create a new project to hold your LookML.

Although you can automatically generate views at the time that you are initializing your project, I usually recommend skipping it at that time and then using the “Create View From Table” option in the file browser. You will still be able to create several views at a time, but you will feel less pressure to include more views than is manageable at once. Just pick a few to get started with, you can always return for more later!

fabio1_0-1689263936776.png

Step 4 - Apply learnings to enhance your autogenerated LookML

Now that you have some views representing your tables, you just need a few small declarations to get to a similar place as the basic sample LookML:

  • Make sure you have a model file
  • Make sure your model has one or more include statements to bring your views into the model
  • Create one or more Explores as the starting point for queries. 
    • You can place Explores directly in the model file or in their own files. The latter is often better for organization in larger projects. If you take this path, make sure to include them into your model as well!
    • You may generate an Explore for each view for easier inspection of data. However, to get started, I recommend just picking one or two to start. The most natural view to use as a starting point is the “fact” view in a star schema, or the view with the most rows of data
  • Add joins to your explore to make sure your data has the necessary context available

Then, also consider some of the ideas from the intermediate sample to get your project looking even more polished:

  • Customized labels for fields, views, and explores
  • Hiding of infrequently used fields
  • Derived fields to apply common business logic at query time
  • Derived tables to reshape data as needed

Step 5 - Continue referring to the samples to discover what’s possible

At this point, you now have a functional and usable model for your users! But of course, there is always more to learn with LookML. If you keep the sample project around, you can refer to the intermediate and advanced models for ideas of what’s possible. And if not, you can also discover new LookML parameters from the sidebar of the Looker IDE, or by browsing the guides and best practices on Looker Docs.

0 0 448
0 REPLIES 0
Top Labels in this Space
Top Solution Authors