LookML Parser/Validation Order with Liquid Variables

Hi there,

I have base view with a dimension that need different joined fields according to the explore.

I want to join just the required view for each explore (not both views on both explore). Of course, LookML validation will fail with “Unknown view”, as my base view (grades) requires both joins. 

I tried to use _explore._name to make a conditional liquid statement, so that I just use the joined measure on the selected explore. But this solution still fails with “Unknown view”.

My question is: when are liquid parameters parsed? According to the docs, _explore._name  works with all LookML parameters that begin with sql.  Wouldn't the conditional liquid be parsed beforehand and remove the not-needed joins?  Or am I missing something? The explore_name is shown correctly for the label, even with the validation failure.

Follows the simplified LookML:

explore: eval_a {

   view_name: grade

   join: concept_a { … }

}

explore: eval_b {

   view_name: grade

   join: concept_b { … }

}

view: grade {

 dimension: grouping_dynamic {
    label: "{{ _explore._name}}: Group"
    sql:  {% if _explore._name == "eval_a" %}
                   ${concept_a.name}

             {% elsif _explore._name == "eval_b" %}

                   ${concept_b.name}
           {% else %}
                  'N/A'
           {% endif %};;
  }
}

view: concept_a {  dimension: name { ...} }
view: concept_b {  dimension: name { ...} }

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