등급은 값을 버케팅하는 좋은 방법이 될 수 있습니다. 하지만 LookML type: tier 측정기준을 사용하면 이러한 버킷이 사전 정의되며 정적입니다. 경우에 따라 사용자가 버킷 크기를 변경할 수 있는 동적 등급을 만들어야 할 수 있습니다. Looker에서 템플릿 언어(Liquid라고 함)와 함께 필터 전용 필드(parameter 매개변수라고 함)를 사용하여 이를 수행할 수 있습니다.
사용자가 원하는 숫자 버킷 크기를 입력할 수 있는 프런트엔드 필터 필드로 사용되는 type: number 매개변수를 만듭니다.
Liquid 변수 {% parameter parameter_name %}를 사용하여 매개변수 값을 참조하는 측정기준을 만듭니다. 이 측정기준은 다양한 버킷을 결정하고 프런트엔드 필터 필드(parameter 매개변수)에 사용자가 입력한 값으로 버킷 크기를 동적으로 변경합니다.
예를 들어 개발자는 사용자가 커스텀 범위를 기준으로 연령 값을 버케팅할 수 있는 동적 연령 등급을 만듭니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-31(UTC)"],[],[],null,["# Creating dynamic tiers\n\nTiers can be a great way to bucket values. However, with LookML [`type: tier`](/looker/docs/reference/param-dimension-filter-parameter-types#tier) dimensions, those buckets are predefined and static. Sometimes you may want to create a dynamic tier that lets users change the bucket size. You can do this in Looker using filter-only fields (called [`parameter` parameters](/looker/docs/reference/param-field-parameter)) in conjunction with a templating language (called [Liquid)](/looker/docs/liquid-variable-reference).\n\n\nYou can also use [custom binning](/looker/docs/custom-fields#custom_binning) to create dynamic tiers natively in Explores when you have [permission to create or edit custom fields](/looker/docs/admin-panel-users-roles#create_custom_fields).\n\n\nTo create a dynamic tier:\n\n1. Create a parameter of `type: number` to serve as the frontend filter field where the user can enter the numerical bucket size they would like.\n2. Create a dimension that references the parameter value with the Liquid variable [`{% parameter parameter_name %}`](/looker/docs/liquid-variable-reference#liquid_variable_definitions). This dimension determines the various buckets and will dynamically change the bucket size to the value entered by the user in the frontend filter field (the `parameter` parameter).\n\n\nFor example, a developer creates a dynamic age tier that lets users bucket age values by custom ranges:\nThe SQL syntax for the following example may need to be adapted to suit your database dialect. \n\n```\n parameter: age_tier_bucket_size {\n type: number\n }\n\n dimension: dynamic_age_tier {\n type: number\n sql: TRUNCATE(${TABLE}.age / {% parameter age_tier_bucket_size %}, 0)\n * {% parameter age_tier_bucket_size %} ;;\n }\n```\n\n\nA user can now choose tier values for the **Age** column in an Explore. For example, a user might want to see ages grouped into 10-year buckets and so enter the value **10** in the **Age Tier Bucket Size** filter:\n\n\nThe SQL expression in the `dynamic_age_tier` dimension divides an age value from the underlying `${TABLE}.age` column --- for example, 25 --- by the parameter value of 10, resulting in 2.5. The value 2.5 is truncated to 2 by the `TRUNCATE` function and is multiplied by the parameter value 10, resulting in 20. 20 becomes the bucket; any age value between 20 and 29 is included in the **20** bucket.\n\n\u003cbr /\u003e"]]