Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Custom Expressions Error in Looker

Hi all, 
I was making a custom expression field in Looker, and coding the custom formula for my dataset in SQL. I have seen the code several times, and debugged it as well. However, each time I get the same syntax error Invalid LookML. 

I don't know where to start on the error.

Solved Solved
1 2 719
2 ACCEPTED SOLUTIONS

Hi @AaryanCodes,

Welcome to Google Cloud Community!

Based on the official documentation, first, when including a Looker field in your expression, start typing the field's name. As you type, the editor narrows your search to a list of fields and functions that contain what you've typed. You can type the name of the field as it appears on the Explore page, or you can use its LookML name if you know it.

When you select a field from the list, Looker adds it to your expression using the LookML name in the form ${view_name.field_name}. This ensures that all of your fields have unique names in your expression.

However, when using custom fields, your Looker admin must grant the create_custom_fields permission first to users or groups to allow access to the feature.

Once you have access to custom fields, you can refer to these guidelines for types of custom fields that you can create:

You can also refer to this code sample which shows a minimal LookML project for an e-commerce store, which has a model file — ecommercestore.model.lkml — and two view files — orders.view.lkml and customers.view.lkml

I hope the above information is helpful.

View solution in original post

2 REPLIES 2