Feature request - SQL WHERE but only if joined

Sometimes I have two simple views connected to each other but since it’s LEFT_OUTER, there may be some entity records without the equivalent on the right side.

However, if I use only fields from the right side of the join (imagine aggregation, history, enrichment table) then I may get a NULL in my dimension. 

Ideally I would like to be able to set up a conditional join that if any fields from the right side are used, there can’t be any nulls. 

explore: users {
join: users_daily {
type: left_outer
relationship: one_to_many
sql_on: ${users.user_id} = ${users_daily.user_id} ;;
sql_where_if_used: ${users_daily.user_id} IS NOT NULL ;;
}
}

Of course I can’t change it into INNER because I will lose the left side. I could create separate explore for the right side but I think with such small feature, I could avoid a lot of duplicated code.

0 2 85
2 REPLIES 2
Top Labels in this Space
Top Solution Authors