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: Best-practice design patterns for various types of analysis
- Source Blocks: Analytics for a third-party data source (e.g. Salesforce, Zendesk, Stripe), based on the schemas produced by Looker’s ETL partners
- Data Blocks: Pre-modeled public data you can add to your models (see below)
- Data Tool Blocks: Techniques for specific types of data analysis
- Viz Blocks: Custom visualization types you can use to display your query output (see below)
- Embedded Blocks: Techniques for embedding data into custom applications
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.
Looker includes a variety of native visualization types. If, however, you have charting needs that are not covered by Looker’s native visualization types, you can also add your own custom visualization types.
To learn more about a Viz Block, select the visualization type in the Viz Block category of the Blocks Directory, then click See the Code and navigate to the Viz Block’s
READ.ME file. The
READ.ME file shows an example of the visualization and gives more information about the Viz Block. For some visualizations the
READ.ME file also provides a URL and instructions for adding the Viz Block.
To add the visualization type to your instance, see the instructions in the
READ.ME file (if any) and the information on our Visualizations documentation page.
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 User Forum topic 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.