Problem creating custom measure with dynamic_fields api parameter

Hi! I’m having some trouble creating a custom measure via the Looker API (4.0). Technically, I’m using the JavaScript SDK via extension framework, but I get the same results via standalone API as well.

I’m trying to make a new custom measure based on an existing dimension, but the measure needs to be of type number. However, these are the only types of measure I seem to be able to create (screenshot from the custom fields user interface below)

Trying to pass type number into the dynamic_fields parameter (the API way to create custom fields) and it fails. It just gives up and makes my custom field a dimension instead of a measure (no errors communicated to me)

  1. Why are these the only measure types I can create?
  2. How can I create a custom measure of type number?

Thank you! I know you’re all super busy, but it would really help me out to have some clues here.

(relevant documentation: https://docs.looker.com/exploring-data/adding-fields/custom-measure)

0 1 349
1 REPLY 1

Hello @StevenSchrembec,

I’ve thought through your problem a bit; I’m not sure Looker means for us to create custom number measures. Reading the documentation on the measure type number.

A measure of type: number does not perform any aggregation, and is meant to perform simple transformations on other measures.

Maybe the intended use is to create a custom measure and wrap it in a custom dimension? I’m not sure that helps, but thought I’d add the thoughts here for others.

Kind regards,
–Thomas