사용
explore: explore_name {
view_name: view_name
}
|
계층 구조
view_name |
기본값
이름이 Explore의 이름과 일치하는 뷰
수락
기존 뷰의 이름
|
정의
view_name는 Explore의 필드를 정의할 뷰를 결정합니다. view_name이 생략되면 Looker는 기본 뷰 이름이 Explore 이름과 동일하다고 가정합니다. 일반적으로 view_name는 동일한 뷰에서 여러 Explore를 만드는 데만 사용됩니다.
예시
users라는 뷰를 기반으로 고객이라는 옵션을 Explore 메뉴에 추가합니다.
explore: customer {
view_name: users
}
일반 과제
view_name, from, label은 혼동되는 경우가 많지만 동작이 다릅니다.
view_name, from, label 매개변수는 유사하지만 효과가 다릅니다.
view_name 사용
view_name를 사용하여 동일한 뷰에서 여러 Explore를 만들고 각 Explore에 대해 동일한 방식으로 필드를 참조합니다.
explore: customer {
view_name: users
}
# Would appear in the Explore menu as 'Customer'
# Fields would appear like 'User Name'
# You would reference fields like ${users.name}
explore: buyer {
view_name: users
}
# Would appear in the Explore menu as 'Buyer'
# Fields would appear like 'Users Name'
# You would reference fields like ${users.name}
view_name: users를 사용하면 생성된 SQL에서 FROM schema.users AS users과 같은 원래 테이블 이름을 사용합니다.
from 사용
from를 사용하여 동일한 뷰에서 여러 Explore를 만들고 각 Explore에 대해 필드를 다르게 참조합니다.
explore: customer {
from: users
}
# Would appear in the Explore menu as 'Customer'
# Fields would appear like 'Customer Name'
# You would reference fields like ${customer.name}
explore: buyer {
from: users
}
# Would appear in the Explore menu as 'Buyer'
# Fields would appear like 'Buyer Name'
# You would reference fields like ${buyer.name}
from: users를 사용하면 생성된 SQL에서 원래 테이블 이름의 별칭이 FROM schema.users AS customer와 같이 지정됩니다.
label 사용
동일한 뷰에서 여러 Explore를 만들 필요가 없고 Explore의 이름이 Explore 메뉴에 다르게 표시되기를 원하는 경우 label를 사용하세요.
explore: users {
label: "Customer"
}
# Would appear in the Explore menu as 'Customer'
# Fields would appear like 'Users Name'
# You would reference fields like ${users.name}
알아 두어야 할 사항
view_name는 Explore 이름을 바꾸는 데 거의 사용되지 않습니다.
확장 모델을 만들고 동일한 뷰에서 여러 Explore를 만들어야 하는 경우가 아니라면 view_name를 사용하여 Explore 이름을 바꾸는 것은 일반적이지 않습니다.
기본 뷰의 이름을 바꾸거나 label를 사용하여 필드 선택 도구에 Explore가 표시되는 방식을 변경해 보세요.