How do I turn a dimension of type string into a measure?

Knowledge Drop

Last tested: Apr 6, 2020
 

In some cases, users want to turn their dimension of type string into a measure (to put into a pivot, for example).

To turn a dimension of type string into a measure, we can create a measure of type string and put an aggregation into the sql parameter so that it doesn't throw the GROUP BY/ AGGREGATION error, like so:

measure: gender {

type: string

sql: max(${table}.gender);;

}


 

This content is subject to limited support.                

Version history
Last update:
‎06-14-2021 06:16 PM
Updated by: