Ability to set different group labels for fields for different explores

  • 29 July 2021
  • 1 reply
  • 462 views

We have group labels set for views/explores that are joined into other explores. Often, we’ll only join a few needed fields into another explore and either don’t want the group labels from the “base” explore or want to change the group labels. I don’t think this is possible at the moment. Any ideas?

Best solution in my mind would be to add a group label parameter to join fields and/or sets.


This topic has been closed for comments

1 reply

@tnebesar You can leverage Liquid here.

 

For example
dimension: your_dimension {

    group_label: "{% if _explore._name == 'explore_1' %}Desired Group Label 1{% if _explore._name == 'explore_2' %}Desired Group Label 2{% else %}Desired Group Label 3{% endif %}"

    type: string

    sql: ${TABLE}."YOUR_DIMENSION" ;;

  }

 

What you should expect

  • In Explore 1 Your Dimension will be nested under the group label Desired Group Label 1
  • In Explore 2 Your Dimension will be nested under the group label Desired Group Label 2
  • In all other Explores where you surface Your Dimension, it will be nested under the group label Desired Group Label 3

 

You can also exclude the group label from a specific explore:

  • For example, use the != operator and omit the {% else %} clause to unnest a field from its group label in a specific explore
    • In Explore 1 Your Dimension will not be nested in a group label.
    • In all other Explores where Your Dimension is surfaced it will be nested under Desired Group Label

group_label: "{% if _explore._name != 'explore_1' %}Desired Group Label{% endif %}"

 

 

Shoutout to @Peggy_Beard (Department of Customer Love) who helped discover this solution over Live Support chat!