Conditional filtering and drilldow on measure

I have a measure that has a three conditions and i need to have a drilldown on first condition and no drilldown on two others and I need to have a filter on all three of them. I can do either filter or drilldown, but then drilldown shows too many rows for the second condition. how can I resolve this?
This is the code I have:
measure: new_count {
type: number
sql: if(${count_field_1} = 0, 0, ${count_field_2}) ;;
drill_fields:[worker_full_name, role_category, worker_source_employee_id, worker_phone_number, facility_name, facility_type, facility_count, worker_id]
}
Can’t have filter with this.
I have another code:

measure: new_count_2 {
type: number
sql: case when ${count_field_1} > 0 and ${violation} = “Yes” then ${count_field_2}
when ${v} = 0 and ${ho_violation} = “No” then “0”
else ‘null’;;
drill_fields: [worker_full_name, role_category, worker_source_employee_id, worker_phone_number, facility_name, facility_type, facility_count, worker_id]
}
And the first condition bring the correct numbers and the drilldown is correct, but the second condition shows the correct number, but in drilldown it shows records because they are not being filtered out. I want either no records in drilldown or no drilldown for the second and third conditions
Is there a way to do it?

0 0 299
0 REPLIES 0
Top Labels in this Space
Top Solution Authors