Custom Sorting in Looker

Good afternoon,
Is there a way to predefine, in the semantic layer of Looker, which sorting types I would like to be the default?

Example: Company, Branch, Group, Subgroup, Cost Center
exactly in this order.

Currently, I can only do it by clicking on the field and holding down SHIFT, adding the other sorting orders.

You could consider defining a query parameter to create modeled analyses for the Explore. The modeled analyses will be listed in the Quick Start section of a blank Explore.

Leveraging the sorts:

Use sorts: [field1: asc|desc, field2: asc|desc, …] to define the custom sorting you have in mind. Any additional dimensions added via the UI will respect the sorting you’ve defined

See this example as a reference:

explore: +order_items {
query: sorted_hierarchy {
description: “Product Hierarchy sorted”
dimensions: [products.category, products.department, products.brand]
measures: [orders.count]
sorts: [products.category: desc, products.department: asc, products.brand: desc]
}

Learn more about the query parameter here: query  |  Looker  |  Google Cloud Documentation

If this was helpful please mark as closed

1 Like