7 Replies Latest reply: Oct 18, 2016 1:30 AM by Anto Raic RSS

    Set Analysis with embeded functions

    Anto Raic

      Hey Guys,
      I'm new to Qlik Sense and have a question regarding Set Analysis using some embedded function.

       

       

      I use  some embedded functions to get the latest Calendar Year, from my Filter Pane as so:

      SubField(GetFieldSelections([Calendar_Year_Nbr],',',GetSelectedCount([Calendar_Year_Nbr])),',',GetSelectedCount([Calendar_Year_Nbr]))

       

      When I embed this formula in a table it returns the correct result (Single Year of: 2016) based on my selection criteria.

       

      As in the screenshot below:

      table_Selection.JPG

       

      However when I embed the formula as part of a Set Analysis in a KPI it still returns results from multiple years (2015,2016)
      Here is my Set Analysis formula:
      count( distinct {$< Calendar_Year_Nbr = {"=$(= SubField(GetFieldSelections([Calendar_Year_Nbr],',',GetSelectedCount([Calendar_Year_Nbr])),',',GetSelectedCount([Calendar_Year_Nbr])))"}>} Dim_Case_DEX_Key)


      Here is the a screenshot of the KPIs with the calculated KPI from above. (highlighted in yellow):KPI results.JPG
      As you can see it still contains the aggregated result of 2015,2016 rather then just 2016.

      Its should give the same result as the KPI  "Hardcoded 2016" on the left 1.49M
      Any help would be much appreciated.

       

      Regards Anto