Set parameter value in a different view

Hello! I have a view that has a parameter. It is structured just like this

view: table_1 {
  derived_table: {
    sql:
  SELECT
    CASE
    WHEN {% parameter timeframe_picker %} = 'Day' THEN DATE_TRUNC(date, day)
    WHEN {% parameter timeframe_picker %} = 'Week' THEN DATE_TRUNC(date, week)
    WHEN {% parameter timeframe_picker %} = 'Month' THEN DATE_TRUNC(date, month)
    ELSE NULL
    END
    AS date

Now I'm trying to build a second view querying the first one, just like this:

view: table_2 {
  derived_table: {
    sql:

SELECT * FROM ${table_1.SQL_TABLE_NAME}  …

I also created a parameter on table_2 and I tried multiple times in different ways to make parameter from table_2 to dialogue with parameter from table_1. But I always get this error:

7c3dc106-0cb7-4d24-ae41-fcac9eee145c.png

Even when I try to specify the parameter using ._parameter_value or to write it as view_name.parameter_name. Nothing works. How can I create this table_2 necessarily using the table_1? Can someone help me please? ?

3 0 274
0 REPLIES 0
Top Labels in this Space
Top Solution Authors