Undo & Redo in Explores
When you're building your Explore queries you can sometimes get in a bit of a mess when you're trying different things. Maybe you've added some fields you don't want, done some sorting to check on the values of data, or changed some visualisation setting and then decided you preferred how it was previously.
Well, there's an easy way to go undo and redo (almost) any changes you make when you're exploring!
As a web-based application, Looker is largely URL based. Looker's representation of an Explore query includes all the information on the fields included, pivots, sorts, filters, custom fields/table calculations, as well as the selected visualisation and its chosen settings.
Whenever you change any of these things, look at the URL, and you'll see the qid=
parameter changes too. This is because Looker has stored a new query with the changed settings.
Knowing this, you can effectively have undo and redo functionality - simply use your browser's back and forward buttons!
There are some limitations to this. For example, while re-ordering columns in the table visualisation does indeed generate a new query and change the qid
, using the back/forward buttons doesn't actually update the visualisation as displayed. If you open the URL in a new tab or refresh, you will see the changes.
Try it for yourself - it can be really handy, especially if you're making multiple similar queries when building dashboards.
Bonus tip: If you're a developer, it's also good to know that if changes to the query change the generated SQL, that happens whenever you make changes too, so you can check your LookML is working the way you want it to.