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;;
}