Rename columns used in a Join

VladL
New Member

Hello!

I would like to join to the same field with two different ids in a parent table and rename the columns instead of having them share the joined column’s name:

(action model)

   join: updated_by {
    from: users
    type: left_outer
    view_label: "Action"
    fields: [updated_by.full_name]
    sql_on: ${action.updated_by} = ${updated_by.id} ;;
    relationship: many_to_one
    }

  join: completed_by {
    from: users
    type: left_outer
    view_label: "Action"
    fields: [completed_by.full_name]
    sql_on: ${action.completed_by} = ${completed_by.id} ;;
    relationship: many_to_one
  }

(users view)

  dimension: full_name {
    type: string
    sql: CONCAT(${TABLE}.first_name, " ", ${TABLE}.last_name) ;;
  }

What I get with this is two fields in my Action explore that say “Full Name”; what I’d like to see is these fields renamed “Updated Name” and “Completed Name” (e.g. use a label with the join). It looks like I can create a lot of repeating dimensions for each of these full names but that seems like a lot of redundant LookML.

0 5 2,041
5 REPLIES 5
Top Labels in this Space