Derived table based off view

  • 19 August 2020
  • 6 replies


I am trying to build a derived table that aggregates another derived table . Is there a way for me to build my second view using sql clause FROM my first view?

For example-

View1-Select a, b, c from table X

View2: Select a, max© from View1

6 replies

You can reference the first view using the syntax ${view_1_name.SQL_TABLE_NAME}

Thank you! In using that syntax it works but I am getting an error below. I have a date_filter in the original view but it seems to not recognize it when I reference it in a second sql query?

A LookML model issue prevented this query from running.

Variable not found “date_filter”. Note that liquid in the “sql” of a “derived_table” must reference fully scoped field names (i.e. “join_name.field_name”) when the view is joined into an explore using “from”.

Interesting. Did you scope the filter with view_1_name.date_filter?

I was able to create a new join rather than reusing a filter. But thanks for the input!

Great! As long as a solution was found 🙏

@dphigravity can you elaborate how you did that? I am facing the same issue. I want to reuse the same filters in two views.