Reference aliased join from main_explore explore

lookml
low_priority
done
reply
(Aitor Cereceto) #1

Hello friends.
I have in a explore main_explore 2 joins: one is parent and other is children from: parent (this is for doing alias if I need to do join parent explore more than once). In the main_explore explore I have a dimension reference to the children as sql: case when ${children.attribute}... but the validation shows an error View "children" does not exists in the model "main" and same but for model embed. Obviusly, will not exists because is an alias of parent, and I cannot declare it in the main model. Any suggestion?

Example:

main
explore: conversations{
...

join: users{
 view_label: "Assigned Agents"
 type: left_outer
 relationship: many_to_one
 sql_on: ${conversations.get_agent} = ${users.user_id}   ;;
}
join: messaging_agents {
  from:  users
  view_label: "Messaging Agents"
  type: left_outer
  relationship: many_to_one
  sql_on: ${messages.created_by} = ${messaging_agents.user_id}  ;;
 }
}
///////////////////
conversations

#dimensions
dimension: hub_team{
type: string
sql: CASE
         WHEN ${users.name} ilike  'xxxx' then 'ccc'
         WHEN  ${users.name} ilike  'xxxx' then 'dddd'
      END;;
}
dimension: hub_team_messaging{
 label: "Hub team (Messaging agent)"
 type: string
 sql: CASE
      WHEN ${messaging_agents.name} ilike  'xxxxx' then 'ccc'
      WHEN  ${messaging_agents.name} ilike  'yyyyy' then 'dddd'
    END;;
 }
0 Likes

(Izzy) #2

In your example lookml below, the error would be View "messaging_agents" does not exists in the model "main"?

I tried to replicate with your LookML example, but I couldn’t replicate the error. The error you’re specifically referencing is generally related to missing includes: statements, not any wacky extends stuff. Could you make sure you’re including the relevant view files in the model main? Even just trying to add include: "*.view.lkml" to test and see if that resolves the issue would be worthwhile.

0 Likes