Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Dair_Junior
New Contributor II

Problem in drill-down with dynamic labels

Hi, Friends!

I need some help with a drill-down dimension I'm trying to use in my app.
I have a historical database with 2 years, in witch I must compare the results from this year (TY) and last year (LY).
I'm using a combination chart with a driil-down containing month and day dimensions, and a I have a filter where I can choose a specific date from the current year.
When no value is selected in this filter, the labels of the months are shown as a generic description of M0, M-1, M-2, M-3... (where M0 represents the month of the Presentation Date). But when I select a date value, this labels must show the real month description (FEB, JAN, DEC, NOV...)
To make this dynamic labels, I'm using expressions on the drill-down dimensions with a variable to know when a value is selected for the filter Presentation Date, so I can present the desired label.
The problem is that when using this calculated dimension, the drill-down effect doesn't work correctly, instead of presenting the days, it just present the selected month.

Below the images to illustrate the problem:

Image 1: no value selected for the filter, months in generic description

ex01.PNG

 

Image 2: value selected for the filter, months with correct labels for the fisrt chart

ex02.PNG

Image 3: specific month selected in the chart, instead of showing the days (like chart 2), chart 1 only shows the month:

 ex03.PNG

 For the Chart 2 I used this drill-down dimension:
     First dimension:
           =If(IsNull(MONTH_LY)=0 ,MONTH_LY ,MONTH_TY)
     Second dimension:
         =If(IsNull(DAY_LY)=0,DAY_LY,DAY_TY)

And for the Chart 1, this:
     First dimension:
          =If(IsNull($(v_PresentationDaySelection_LY))=0 
                             ,$(v_MonthDescription)
                             ,If(IsNull($(v_PresentationDaySelection_TY))=0 
                                               ,$(v_MonthDescription)
                                              ,$(v_Month)
                                   ) 
                              )
     Second dimension:
           =If(IsNull(DAY_LY)=0 ,DAY_LY ,DAY_TY)

 

The variables are:

v_MonthDescription:
      If(IsNull(MONTH_DESC_LY)=0 ,MONTH_DESC_LY ,MONTH_DESC_TY)

v_Month:
     If(IsNull(MONTH_LY)=0 ,MONTH_LY ,MONTH_TY)

v_PresentationDaySelection_LY:
     GetFieldSelections(PRESENTATION_DATE)

v_PresentationDaySelection_TY:
     GetFieldSelections(PRESENTATION_DATE)

Anyone can help with this problem, please?

Dair Junior
2 Replies
Channa
Valued Contributor III

Re: Problem in drill-down with dynamic labels

since you are selecting date then pass that date to variable and use condition

if date=vdate , JAN,else M1

or else

if(count(selectdate)=1 ,Jan,M1)

Channa
Dair_Junior
New Contributor II

Re: Problem in drill-down with dynamic labels

I'm using it this way, but the problem is that a variable in the calculated dimension (or using the GetFieldSelections () function directly) makes the drill down dimension to get lost to show the data correctly, as it can be seen in the Chart 1 of the Image 3 above, where instead of showing the days values, as in Chart 2, it's just exhibiting the consolidated month.
Dair Junior