Looker Community

Issue while joining 2 Derived Tables

Hello guys,

I currently have a some views that need to be joined, but somehow I am facing an replication issue.

My setup
Currently using impala, with tables partitioned by yyyymmdd.

Views
Most of my views are Derived Tables, in which I use a templated filter in order to reduce load on the cluster.

Examples
Below I have two views, that are assisted by the use of templated filters:

view: dt_1 {
  derived_table: {
    sql:
      select *
      from table_1
      where
        {% condition date_filter %} ymd {% endcondition %};;
    }

dimension_group: ymd {
    type: time
    datatype: yyyymmdd
    timeframes: [date, month, week, year]
    sql:${TABLE}.ymd;;
  }

  filter: date_filter {
    type: date
    datatype: yyyymmdd
  }

view: dt_2 {
  derived_table: {
    sql:
      select *
      from table_2
      where
        {% condition date_filter %} ymd {% endcondition %};;
    }

dimension_group: ymd {
    type: time
    datatype: yyyymmdd
    timeframes: [date, month, week, year]
    sql:${TABLE}.ymd;;
  }

  filter: date_filter {
    type: date
    datatype: yyyymmdd
  }

Let’s say that I need to join both views, knowing that the date_filter needs to work for both of them:

Model

explore: dt_1 {

  join: dt_2 {
    relationship: one_to_many
    type: inner
    sql_on: ${dt_1.id} = ${dt_2.id} AND ${dt_1.ymd_date} = ${dt_2.ymd_date} ;;
  }
}

However, whenever I am exploring this, and I select the date filter on one of the views, the selection does not get replicated to the other.

Does anybody have any clue on how to make this work?