Question

Extending Filters to drill fields

  • 8 July 2017
  • 3 replies
  • 1450 views

I am having two measures in my look. ‘Measure a’ is Count(*) and ‘Measure b’ is count(column) when creation_date <= Start_Date. The have drill fields for both filters and when I drill on measure A, I am getting correct results. But when I drill on Measure B, It is not just bringing the filtered data but also bringing other records that are present in ‘Measure a’ Drill.


Is there a way I can get only filtered values in Measure B drill down?


3 replies

Thanks @sam. This Worked.Thanks a lot!

Thanks @sam!! I will test this😊

Userlevel 5
Badge

Hi @sriharsha,


When you drill, all the filters on the explore and all the filters of the measure will be brought through. If you were writing in this filtering logic via the sql parameter rather than via the filtered measures notation, then that won’t be brought through. Make sure you’re applying the desired filters using the filtered measure notation:


measure: this_week_count {
type: count_distinct
sql: ${column};;
filters: {
field: created_date
value: "7 days"
}
}

In your example, creation_date <= Start_Date would need to be its own dimension to be used in a filtered measure. So you could make a yesno dimension that checks that condition:


dimension: created_before_start {
type: yesno
sql: ${creation_date} <= ${Start_Date} ;;
}

And then, filter on that condition being “yes”:


measure: measure_B {
type: count_distinct
sql: ${column};;
filters: {
field: created_before_start
value: "yes"
}
}

Reply