Looker Blocks are building blocks—pre-built pieces of LookML that you can leverage to accelerate your analytics. Reuse the work others have already done rather than starting from scratch, then customize the blocks to your exact specifications. From optimized SQL patterns to fully built-out data models, Looker Blocks can be used as a starting point for quick and flexible data modeling in Looker.
There are many Looker Blocks to choose from. To find out what Blocks are currently available, check out the Blocks Directory and click the desired category. Or, click the name of a category below to see the current selection of blocks for that category:
- Analytic Blocks—contain best-practice design patterns for various types of analysis.
- Data Blocks—pre-modeled public data you can add to your models (see below).
- Data Tool Blocks—techniques for specific types of data analysis.
- Embedded Blocks—techniques for embedding data into custom applications.
- Source Blocks—offer analytics around a third-party data source (e.g. Salesforce, Zendesk, Stripe), based on the schemas produced by Looker’s ETL partners.
When you find a block that interests you on those pages, click the block’s description to see usage instructions specific to that Block.
Blocks typically include a data model and then you provide the data. Data Blocks are a special type of Looker Block because they also provide the data set. Looker Data Blocks include public data sources, including:
- Demographic data—common demographic metrics from the American Community Survey at the state, county, ZIP code tabulation area, and even census block group level.
- Economic indicator data—information on key United States economic indicators (provided by Quandl) focusing on inflation, unemployment rates, interest rates, debt, and growth indicators.
- Exchange rate data—daily closing historical exchange rates for major currencies going back to the introduction of the Euro in 1999.
- Geographic mapping data—mapping files that make it easy to translate between different geographic areas like block group, census tract, ZIP code, county, and state within the United States.
- Weather data daily—weather reporting in the United States at the ZIP code level from 1920 through the previous day.
To see the full list of currently available data blocks, see the Data Block category of the Blocks Directory.
Adding a Block to Your Model
Directions for adding a Block to your model can be found in each Block’s respective entry in the Blocks Directory. And of course, feel free to reach out to a Looker Analyst for assistance.
The ease of using a Block will vary, depending on the degree to which your database schema might be standardized:
Data Blocks, which include both public data sets and full LookML models, simply require copying the LookML model from the GitHub repo and using LookML’s Project Import feature to access the modeled tables. See this Discourse article for detailed instructions.
Data collection applications, such as Segment and Snowplow, track events in a relatively standardized format. This makes it possible to create templatized design patterns—capable of data cleansing, transformation, and analytics—which can be used by any customer using these applications.
Other web applications—including Salesforce and Marketo—let you add custom fields for your internal users. Naturally, this creates data in a less standardized format. As a result, we can templatize some of the data model to get the analytics up and running, but you’ll need to customize the non-standardized portion.
Finally, we have Blocks for general business insights. These are optimized SQL or LookML design patterns that are data source agnostic. For example, the lifetime value of a customer over time is an analysis that many companies want to perform. There are some assumptions baked into these patterns, but they can be customized to match your specific business needs. These patterns reflect Looker’s point of view on the best way to conduct certain types of analysis.
If you’re new to Looker, your Looker Analyst can help you get the most from these models.
Some things to keep in mind:
- Some Blocks demonstrate both Explores and views in the same file. This is for ease of viewing, but generally speaking, you’ll want to copy the appropriate sections of LookML into the appropriate places in your data model. See Understanding Model and View Files for more information.
- In some cases you’ll probably want to create new LookML files in your data model to house the examples.
- Most Looker Blocks require some customization to fit your data schema, as discussed earlier in this section. Data Blocks are the major exception as they provide both the data model and the data.