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:



37 replies

Userlevel 7
Badge

@lindenPMP - I don’t have any new in-product hacks myself, but since Looker’s extensibility interfaces have grown so much in the past year or two (extensions and OAuth for the API in particular), I think a lot of us have been making cool things in that space.

One that I got through our open sourcing process is here. It’s a sample lightweight Node.js server that helps translate OAuth-authenticated users into backend service-account authenticated API calls for exposing limited administrative capabilities to your end users: https://github.com/looker-open-source/micro-admin-for-looker

Hey @izzy  @fabio@Dillon_Morrison@ernesto@will.adams@jeffrey.martinez  this is one of the coolest threads I’ve found in Community! Not sure if similar iterations that are more recent exist, and I don’t know about anyone else, but I’d love to see what tips & tricks folks have picked up over the past year or two... that’s a lot of version releases and feature updates… what do ya say we bring it back?!

Not exactly a hack but something that I recently noticed.


When you use the ‘fold LookML’ option, how much of the code it folds depends on where your cursor is. I had always assumed it just collapsed everything completely which was a bit annoying as generally in a view I want the view itself expanded but all the dims/measures etc collapsed - and this is what happens so long as your cursor is inside the view: myview { } block. Magic!

Userlevel 7
Badge +1

from @gregono1:


Userlevel 7
Badge +1

X-posting @Dawid_Nawrot’s “Collapse all field groups” bookmarklet to collapse every field in the field picker 🔥🔥🔥


When you want to create a report with a specific order of the columns, you can set up a set of fields with all the fields in the order you want and then use the drill to generate the report (click and then explore from here in the drill result) - instead of manually generating the report - it is also good to keep track of the order - if the order matters!

this is exactly what I came looking for, thank you very much!

Userlevel 3

Not sure this counts as a life hack, but I wrote some CSS to increase the width of the autocomplete dropdown and enable vertical scrolling and it’s made my workflow 10x better 😃


SOURCE:

https://discourse.looker.com/t/a-better-autocomplete-dropdown-for-the-looker-ide/12782

Userlevel 7
Badge +1

😂 😂 😂

If I can add my usd_2 (LookML joke):


On Mac:

Command + Option + 0 to fold all LookML in current file

Command + Option + shift + 0 to unfold all LookML in current file


I guess replace Option with Alt on other OS.


It changed my life!

Userlevel 7
Badge

Kinda remembered this one way after the fact, but…


If you want to quickly add a hidden field to your explore, just append &f[view.field]=0 to your current URL. This will add the field as an additional filter, without interfering with your other selected dimensions and filters, then you can add the field to your table, if desired, by using the gear menu from the newly applied filter

Userlevel 4

This is such a cool thread, thanks for starting!

And this works when creating table calcs too… Revolutionary

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




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.

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 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 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 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

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

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


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

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 🙂

Userlevel 3

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

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. 🙂

Reply