Measure of Type: List Linking & HTML

Knowledge Drop

Last tested: Jun 8, 2020
 

  1. We cannot currently turn off drill-able links currently when using type: list measures.

2. We cannot currently use HTML with measures of type: list! Its default formatting overrides any html. +1 the feature request here

Janky Workarounds

The workarounds to both of these are pretty much the same. Here's an example we did for preserving html on a list (bold here) and at the same time removing the linking parameter.

measure: email_list_hack {

type: string

sql: GROUP_CONCAT(${email}) ;;

html: <b> {{ value }} </b> ;;

Both methods require turning this into a type: string measure with either a GROUP_CONCAT() or LISTAGG() function in the sql parameter. Type: string measures do not have the type: list default formatting.

We can also create a list in the front end via a table calculation, using offset_list().

If we want to get really hacky, we can still use a measure of type: list but in the list_field parameter, we reference a field that has this html formatting on it. From some testing this seems to override the default linking format and applies bold (for example) to both the list field and the referenced field.

DRILL ON UNDERLYING LIST VALUES

We can simply add drill_fields to this string measure. This should avoid the "clicking the value just takes me to a filtered explore" issue and instead generate a row for each value in the list in the resulting drill, for that specific record. Works with html as well, if we use linked value.

measure: email_list_hack {

type: string

sql: GROUP_CONCAT(${email}) ;;

html: <b> {{ linked_value }} </b> ;; --this is not necessary, preserves drill w/ html

drill_fields: [email]

This content is subject to limited support.                

Version history
Last update:
‎07-07-2021 01:51 PM
Updated by: