How to apply a filter or a sort to a drill-down field?

Knowledge Drop

Last tested: May 13, 2020
 

If we want to drill down on a specific field, but apply an additional filter we can do this using the link parameter. We can build out a link structure similar to a linked explore or dashboard as explained in this article.


Say we want to drill down on count, but only see fields for male users. We can use the link parameter and the f[viewname.fieldname]= syntax.

measure: count {
type: count
drill_fields: [id, state, orders.id, inventory_items.id, city, gender]
link: {label: "Drill" url:"{{ filterdrill_count._link }}&f[users.gender]=m" }
}

The easiest way to do this is to create a normal drill.
Click explore from here.
Apply the filter.
Click Share and grab the expanded filter.
Decode the URL and copy the filter syntax.
Then, apply this to the link parameter.

You are done!

If we want to apply a sort_by we can follow the same process.

This content is subject to limited support.                

Version history
Last update:
‎06-14-2021 05:56 PM
Updated by: