qliksense

Qlik sense - Customize label on drill-down dimension


I am trying to customize labels on drill-down dimensions and after doing some research this is apparently not possible in frontend? It's a problem when you use hierarchy dimension in drilldown and the field names don't have appropriate labels for the visual object.


Solution

  • Correct, you cannot use expressions to dynamically modify Master Dimension labels. If you're willing to go outside the box, though, you can get clever with If() statements to simulate a drilldown dimension.

    Say you had a drilldown dimension that was set up with 3 dimensions in the hierarchy:

    Screenshot of Qlik Sense master dimension properties

    What you could do is create a new variable called vDrilldownDim or something like that and use this expression as the definition:

    =If( GetPossibleCount(TransLineID) = 1
       , If( GetPossibleCount(TransID) = 1
           , 'Dim1'
           , 'TransID'
          )
        , 'TransLineID'
    )
    

    This expression utilizes the GetPossibleCount() function to check whether just 1 value in a given field is Possible to select, at which point it would dynamically "drilldown" to the next field in the expression that has more than 1 value possible to select, which is essentially how a drilldown Master Dimension works, too.

    In your chart objects, you can reference the variable in your field like this:

    =[$(vDrilldownDim)]
    

    ...and in your field label like this:

    ='$(vDrilldownDim)'
    

    Then the behavior is basically the same as a drilldown Master Dimension but you can modify that field label expression above to be whatever you need it to be, or even create a second variable to handle it.

    Screen recording of Qlik Sense drilldown dimension comparison