Question

Looker Life Hacks (Join Me!)


Userlevel 4

Got a looker life hacks like commands to clear selection or force pull from production and more? Would love to hear what you have up on your sleeve! 😉 I’m going to start first!


Life Hack #1: Seeing errors because your local production branch is not up to date?

When changes are pushed to production they push to remote production and sometimes we need to manually update our local production environment. In your LookML page, HOLD SHIFT & CLICK ON THE ARROW next to the Validate Again function. You will get MORE functions. 🙂


What You See Normally

30%20AM


What You See When You SHIFT


Reference:



39 replies

Userlevel 7
Badge +1

I’ve got one— Did you know you can “Option + click” on a field reference in the Looker IDE and it will jump you to the place that field’s defined?


This is a great idea, @nicholaswongsg! Let’s make it exciting—

There’ll be a prize for the user behind the post in this thread that gets the most likes!

Share your secrets for a chance to win… something! 🥳

Userlevel 3

This is such a great idea! One of my favorites that I learned recently is “Cmd-J” or “Ctrl-J” to jump to a specific file in the IDE.



This is super useful for navigating around the IDE quickly, especially when you’ve got a ton of files! I’m so excited to see what else y’all have to share 😃

Userlevel 3

One of my favorites has been option+click on the legend when a pivot makes the chart too cluttered. By default, clicking an item in the legend will hide/show its corresponding line/bar in the chart, doing so while holing down option will hide/show everything else. Becomes really useful when you have 10+ pivot columns, but here’s an example with just a few:


Userlevel 3

Not sure if it’s a life-hack… but it sure is a time-saver that I often forget about --> The Quick Help on the right side of the LookML IDE is clutch when you want to know the available parameters for that type of field, or need a refresher on syntax (or like me, you forget if you need to include brackets, or some “;;” perhaps). It’s dynamic so it changes based on your text cursor location, AND it’s hyperlinked to our docs so you can jump straight to the relevant documentation if you need more info.


Userlevel 4

One of my all time favorites is multiple cursors.

Clicks: ⌘+click on Mac or ⊞+click on Windows

Drags: option+drag on Mac or alt+drag on Windows



Edit a 250 line CASE statement like a hot knife through butter with this trick!

Love this thread! @izzy that one is really cool - looks like it only works within the current file though?


EDIT: looks like I was too hasty and this does let you navigate between files if you click a view_name.field_name reference; doesn’t seem to work from within an extension view though.


I have a couple but I’ll post them as separate replies.

From another account of mine… fold your LookML wherever you want by adding bracket pairs inside comments:


# loads of dimensions I want to fold {
... lots of lookml ...
# } end of all the dimensions I want to fold


One of my favourites, adding LookML search to Chrome (or probably other browsers too).


Chrome lets you add your own search engines which can be triggered in the address bar with a keyword followed by a space: https://support.google.com/chrome/answer/95426?co=GENIE.Platform%3DDesktop&hl=en#edit (other browsers can do similar things I think)


The code search URL for a Looker project looks like this (%s is where the search query goes): https://<LOOKER_INSTANCE>/search?projects%5B%5D=<PROJECT>&q=%s


Once you’ve set this up you can quickly search your LookML project, e.g. my keyword is ‘lk’


Pretty handy for finding stuff quickly.

Userlevel 7
Badge

I love using browsers’ “custom search engines” with my most used dashboards.


Also, I wrote this bookmarklet for one-click downloading in your preferred format which I think qualifies: https://discourse.looker.com/t/one-click-downloading-with-bookmarklets/7079

Userlevel 3

This is blowing my mind! Sweet!

Userlevel 7
Badge +1

This is wild! @fabio was so casual about already knowing this, but this totally blew my mind too.

Userlevel 7
Badge

Izzy, I’ve got a chrome search shortcut set up just for Discourse too ❤


Userlevel 4

THIS GOT TO BE A LIFESAVER. The other day I had to do a CASE statement to change countries input to their proper format… I was using Excel to do the formatting. This will be very handy as well. 🙂

Userlevel 3

Now I know why this occurs. I thought this was bug!

Userlevel 7
Badge +1

I’ll be doling out prizes to the top life hacks at the end of this week! Last chance to contribute and win s-w-a-g 🙂

Thought I’d add some more here and bump the thread (and partly as I’ve posted about some spurious non-issues recently 😊) . Maybe we can get some more contributions before the end of the week.


Some IDE/code related ones:



  • Looker will replace underscores with spaces and capitalise words in field identifiers so you don’t always need to specify a label - it also understands and capitalises some acronyms. The ones I know about are: id, url, uri, http, html, json, sql, usd, sku, ip, isp, api, cpu - are there any more/an official list?



  • If select some code, you can move the whole block up or down by holding alt/option and using the up & down keys - the rest of code moves around it so you can reorganise your code easily

  • The IDE can be set to Vim or Emacs mode under your account settings so you can use familiar keyboard shortcuts

  • You can develop LookML outside of Looker if you want to use features of your favourite text editor, though after committing/pushing your code you need to pull it in the Looker IDE to see your changes. There might be a way to automate this with the API though I haven’t worked that out yet

  • If you’re using an external code editor, set it to use YAML syntax highlighting and it’ll do a fairly good job (I know old LookML was just plain YAML, maybe New LookML is too or very close)

  • More of a personal preference, but for ‘list’ type parameters (fields, timeframes etc) putting each item on its own line is more readable, lets you comment out individual lines, and gives you useful git diffs

  • Always put a newline at the end of files, otherwise git diffs can end up broken

  • Emojis render in the IDE, labels/descriptions and git commits and can be useful/fun for drawing attention to certain things ⚠


And one last one:



  • If you use extended Explores, you can switch a query from one to the other (assuming the fields used exist in both) by changing the explore slug in the URL e.g. /explore/model_slug/base_explore_slug?qid=5wCRdZq7bzbep21MGPTmDi

    –>

    /explore/model_slug/extended_explore_slug?qid=5wCRdZq7bzbep21MGPTmDi

    and vice versa.

Userlevel 7
Badge +1

Adding in on this: @jonathan.walls here at Looker built a package for sublime text to do LookML highlighting!


Userlevel 7
Badge +1

I tried to make VScode treat ikml files as yaml and that doesn’t work, I mean it works but it would highlight most of it as incorrect. *.lookml files on the other hand are totally fine.


ikml files are a combo of JSON and something 😃 but treating is as JSON would also confuse the editor.


It would be awesome if somebody created a plugin for VSCode explicitly for lmkl files

Userlevel 7
Badge +1

@thomas_brittain started working on this, looks like he’s still developing! I bet he’d be grateful for some help 🙂


Userlevel 7
Badge +1

And… 🥁🥁🥁

The results are in!


Despite @ernesto having the highest ❤ count on a single post (20, for his multiple cursor technique), @simon_onfido has the highest overall ❤ count, with 23 between his two contributions. Plus, Ernesto works here. Simon wins!!


@nicholaswongsg will also get a prize for kicking this whole thing off— Keep an eye on your mailboxes, guys.

Userlevel 5
Badge

The Quick Help is invaluable in my opinion. Sadly, it refuses to scroll on my Chrome and my hatred for Safari outweighs my love of Quick Help 😦

Userlevel 3

I’ve noticed the Chrome scroll bug as well. Feel like this is only a recent thing. @izzy feel free to break this out into a separate thread or point me in the direction of an existing one but is this something you’re aware of?

Userlevel 7
Badge +1

Yep, we’ve reproduced this one internally and are getting some resources on it! Thanks for pointing out @bens and @Jonathan_Palmer.

Here is a page of shortcuts that work in the Lookml editor. My favorite is “fold all”




And this works when creating table calcs too… Revolutionary

Reply