Filters to Drill Fields Problem


( ) #1


I have a measure which is a CASE statement and contains a templated filter. The measure also contains a SET of drill fields.

The templated filter is used directly in the dashboard and filters the measure with the intended behaviour, returning the expected results in all Looks.

However my problem is that when I explore the measure to obtain the drill fields, the drill fields are not filtered with the templated filter.

The drill in shows that the templated filter has been applied in the “Details” which is slightly confusing.

I have checked this article which discusses a fix but the “Filters” in the measure discussed renders the same results as above here.

Here is the setup

filter: myfilter{
type: yesno

measure: count {
type: number
drill_fields: [worker_id ,name ,email,phone_number,courier_unassigned_delivery_team ]
sql: CASE WHEN {% condition myfilter%} ‘no’ {% endcondition %} THEN ${measure1} - ${measure2} WHEN {% condition myfilter%} ‘yes’ {% endcondition %} THEN ${measure1} ELSE NULL END ;;



(Elliot Park) #2

Hey Will,

Elliot from Looker Support. Chiming on this one here.

To elaborate on the behavior here, while any filter-only fields (like myfilter) do get passed from first-level explore to following drill queries, the reason you’re likely seeing a discrepancy in your results is due to the fact that the drill_fields of your count do not contain logic to listen to said filter-only field.

In other words, the result drill query that’s generated does contain the proper filter-only field/“myfilter” value, but that filter-only field doesn’t actually affect anything in the drill query.

Hope that helps elaborate on the behavior here, and if you have any other questions, feel free to message back. Cheers!