I have made a new model,
model_2, in my LookML project, and I would like my Looks to use it. However, I built my Looks based off an Explore in
How do I take my existing Look and move it to
model_2, rather than creating a new Look from scratch?
Solution 1: Content Validator
The Content Validator is a tool that checks Looks and dashboards for errors, and it also has a Find and Replace in All Content feature, which you can use to change the underlying model or Explore for all Looks or dashboard tiles that use
Things to note about this method:
- Users must have
developpermission to use the Content Validator.
- The Find and Replace in All Content feature changes all Looks and dashboards on the Looker instance. To apply this change to only a few Looks or dashboard tiles, see the solutions below.
Solution 2: Edit the URL
To change the model for only a few Looks or query-based dashboard tiles (Look-linked dashboard tiles will automatically be updated with the new model reference), we can take advantage of the fact that Looker keeps all the information about a query in the expanded URL. To use this solution to update the model reference to
- From the Look or dashboard tile, click Explore from Here.
- Click the cog in the upper right of the Explore page.
- Select Share.
- Copy the expanded URL and paste it somewhere else, like in a new browser tab. (Don't visit the URL yet, or Looker will hash it into a shortened URL.)
- Change the model name referenced in the URL. The URL takes the following form:
- Visit the newly formatted URL.
- Save the Explore as a Look in the same folder (in Looker versions earlier than 6.20, this was called a "Space"), replacing the old Look. To replace a query-based dashboard tile, save the Explore onto a dashboard as a tile and delete the original tile from the dashboard.
This method can be repeated for each Look or query-based dashboard tile that needs to be changed!
Solution 3: Make a "Breaking" Change
What if we don't want to change the model or Explore reference for all content across an instance, but do want to change the reference for more than one Look or dashboard tile at a time? We can leverage the Content Validator to replace the references for a handful of Looks or dashboard tiles all at once:
- Purposefully "break" the existing model or Explore reference by renaming that model or Explore in development mode. Using our example in Solution 1 above, we would change the model name from
model_1to, for example,
zzz(or another model name you know doesn't exist). This will cause every Look and dashboard that uses
model_1to break. However, they will be broken only in development mode, so no other users will be affected.
- Under the Develop menu, open the Content Validator.
- In the Content Validator, find the looks or dashboard tiles that you want to change.
- Click the inline Replace button to change the model reference to
model_2for each of these looks or dashboard tiles.
- Check that the looks or dashboard tiles work as expected now that they point to the new model.
- Finally, go back to the model that was "broken" and change its name back to the original. In this case, we would change