Why are my fields null in the explore but they show up in SQL Runner?

Knowledge Drop

Last tested: May 13, 2020

 

Explanation

The explore does some front-end operations that SQL Runner doesn't. For example, it tries to use the type defined in LookML to properly show the field values.

Solution

This is almost always because of a type mismatch. Often there is a string field on the database that has been given a type: number in LookML.

Remember that defining a type on a field doesn't do implicit casting. Try casting the sql parameter of your field to the datatype that you think the value should be. For example, sql: CAST(${TABLE}.id AS integer) ;;

This could also happen because of non-unique primary keys, which cause entries for non-unique values to show up as null on the explore page.

This content is subject to limited support.                

Comments

I also came across an instance where this happened because dimension Fill was turned on!

Version history
Last update:
‎04-05-2021 09:10 AM
Updated by: