In LookML, you can use aliasing parameters to make data exploration in Looker a much more user-friendly experience. For example, you might alias a column titled
user_registration_date to make it easier for others to understand what this piece of data describes. You might even take this a step further and try to localize view and field labels to match non-English translations, or even non-Western characters.
Aliasing on the front-end:
label: are the two aliasing parameters we’ll use in this article. These parameters change the names of views and each fields at the front end / UI level, keeping the actual underlying names intact for LookML reference purposes. These also allow you to use non-Western characters commonly used in East Asian languages, since we’re not tampering with how Looker writes SQL, which is restricted by what languages / formatting the database itself can handle. Read more about labeling, field naming, and explore naming here.
eCommerce in Japanese:
Let’s say you have an office in Japan. You can either keep using English as the main language to describe data in Looker, or you could translate labels into Japanese, which is what I did in the example below:
You can see that almost everything from the explore name to each field have been translated into Japanese, even in the visualization, albeit with some caveats.
Do it Yourself:
The example above can be achieved in the following three steps:
label: to change the name of the explore in the model file - this changes the label right above the field search bar.
- explore: order_items
view_label: to change the labels of each view file grouped into this explore in the model file. This changes the labels in the gray bars in the field picker.
- join: inventory_items
label: to change all field names in each view file. This changes the field labels in the field picker list.
- dimension: inventory_item_id