Stay organized with collections
Save and categorize content based on your preferences.
Tiers can be a great way to bucket values. However, with LookML type: 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) in conjunction with a templating language (called Liquid).
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.
Create a dimension that references the parameter value with the Liquid variable {% parameter parameter_name %}. 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).
For example, a developer creates a dynamic age tier that lets users bucket age values by custom ranges:
The SQL syntax for the following example may need to be adapted to suit your database dialect.
A 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:
The 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-22 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"]]