Knowledge Drop

What characters are accepted in LookML field names?

  • 7 July 2021
  • 0 replies
  • 31 views

Userlevel 4

Last tested: Jun 19, 2018
 

TLDR: Only alphanumeric characters and underscores.

For certain characters such as +, you will usually get an error in the LookML validator to confirm that only alphanumeric characters and underscores are acceptable: Invalid field name "view_name.field_name+". Field names may only include letters, numbers and underscores for [dialect].

Looker does accept periods in field names, but as a best practices recommendation, you should avoid having periods in the field names, once this can cause some unexpected behaviour.

For the most part this will go over well, with only the following note in the Quick Help section: The period (.) character in field names creates an explicit scope. This can cause problems with certain types of joins. Consider using view_label to organize fields. However, Looker parses the second to last part (string2) of the "string2.string" reference as the view name. This is problematic when we join the same view to an explore twice. Because there is no view name or join being passed into the lookML definition due to the period, the LookML validator will give us the following error:

Redefinition of field 'string2.string'

 

This content is subject to limited support.                

 

 


0 replies

Be the first to reply!

Reply