Solved

Can you filter a drilldown set?

  • 11 December 2020
  • 2 replies
  • 106 views

So, I have a model that has all the lines of data for a customer, whether a license is active or expired (this is necessary for customer records).  I want to drilldown on the count of servers, but when I do, I get all the lines from the customer.  Is there a way that I can filter the drilldown set in the view.lkml using the filters: parameter to do something like filters:[“status = active” & count > 1] 

icon

Best answer by shaandalwadi 14 December 2020, 12:34

Hi AnnS,

 

You can customise the drill-down options given by using the ‘link’ parameter.

In this case, you can customise the filters that get applied by adding in the LookML in red below (replacing ‘view_name’ with your view name, and ensuring that dimension/measure names match up properly):

 

    measure: count_servers {
      type: count_distinct
      sql: ${server_id} ;;
      drill_fields: [detail*]
      link: {
        label: "Drill-down filtered on active licenses"
        url: "{{ link }}&f[view_name.status]=active&f[view_name.count]=%3E1"
      }

    }

 

This will give you a drill-down option labelled "Drill-down filtered on active licenses", which returns the previous drill down results but filtered on status = ‘active’ and count > 1.

 

Best wishes,

Shaan

View original

2 replies

Hi AnnS,

 

You can customise the drill-down options given by using the ‘link’ parameter.

In this case, you can customise the filters that get applied by adding in the LookML in red below (replacing ‘view_name’ with your view name, and ensuring that dimension/measure names match up properly):

 

    measure: count_servers {
      type: count_distinct
      sql: ${server_id} ;;
      drill_fields: [detail*]
      link: {
        label: "Drill-down filtered on active licenses"
        url: "{{ link }}&f[view_name.status]=active&f[view_name.count]=%3E1"
      }

    }

 

This will give you a drill-down option labelled "Drill-down filtered on active licenses", which returns the previous drill down results but filtered on status = ‘active’ and count > 1.

 

Best wishes,

Shaan

Thank you!  That worked perfectly!

Reply