join based on multiple conditions

I am trying to join 2 tables in the explore using sql_on.

The first condition is ON and the second condition, I want to use the value from the row i.e. if user selects cheese then pass item_name=’cheese’ 

Can this be done in looker ?

view: order_items {

dimension: order_id
dimension: item_id
dimension: item_name

}

view: orders {

dimension: id
dimension: user_id
dimension: username_name

}


explore: order_items {
join: orders {
type: left_outer
relationship: many_to_one
sql_on: ${order_items.order_id} = ${orders.id} AND ${order_items.item_name}='<Dynamic Item name that is selected>' ;;
}
}
0 1 452
1 REPLY 1

@will_adams any suggestions to achieve this

Top Labels in this Space
Top Solution Authors