Using URLs and Query Parameters

Background on the URL

In Looker pre-3.18, the url is a long list of parameters which includes the fields, filters, filter values, pivots, row limits, column limits, total settings, row total settings, and sorts.

In Looker 3.18 and later the url is hashed and stored in a slug, which is used to generate the query. No matter the version, the following parameters can be used to generate queries.

Parameters and How to Use Them

Important: Any field in the pivots or sorts list must also reside in the fields list.

A general url with all of the parameters:


https://company.looker.com/explore/model/explore_name?fields=view.field_1,view.field_2,view.count
&f[view.filter_1_dimension]={{ value }}
&f[view.filter_2_on_date]=last+60+days
&pivots=view.field_2
&limit=50
&column_limit=20
&total=true
&row_total=right
&sorts=view.field_1,view.count+desc

Explanations for each parameter:

  • fields: The list of fields used. You may also use a set from a view as such fields=view_name.set_name*
  • f[]: Declaration of a filter with it’s respective value. Any additional filter is declared with another f[view.dimension_name]
  • pivots: The set of dimensions you want to pivot in the look.
  • limit: The limit for the query. Any value > 5000 will default to 5000.
  • column_limit: The column limit. This only exists if there is at least one pivoted dimension.
  • total: Column totals toggle. The value for this is either true or false (off or on, respectively).
  • row_total: Row total toggle. The value for this is either true or false (off or on, respectively).
  • sorts: The fields to sort on. Default or no value entered is ascending sort.

Note (October 2017):

The code above this post is obsolete, as we now allow folks to reference the current filters placed on a given dimension or measure and pass them along in the HTML, which works great for passing filters between dashboards.

The code looks like this: _filters[‘field_name’]

For example:

dimension: company {
  type: string
  sql: ${TABLE}.company

link: {
label: “Activity Overview”
url: “/dashboards/123?Date={{ _filters[‘user.created_at’] | url_encode }}”
}
}

4 25 15.7K
25 REPLIES 25
Top Labels in this Space
Top Solution Authors