4 Replies Latest reply: Nov 16, 2016 3:21 PM by Stefano Draghi RSS

    Using condition to change expression on Qlik Sense charts

    Stefano Draghi

      Hi everyone,

       

      I am trying to create a chart that alternate expressions based on field selections using a formula similar to this one.

       

      If( GetSelectedCount( Year )=0 and GetSelectedCount( Month_Year )=0, 

       

      Sum( {< Date= {">=$(vMin_Date)<=$(vMax_Date)"} >} Value),  Sum( Value)  )


      I basically want to restrict my data within a range when there are no selections made to the year and month_year fields.

       

      This condition works perfectly in tables and KPI objects, however, it behaves in a strange way in charts. When there are no selections made in the year and month_year fields, the only values shown are in the range determined in the set analysis, but, all the other dates still appear with zero values. Like shown in the image below.

      Capturar.PNG

      Note that there are values for all periods in my data model.


      Anyone has any insights on why this might be happening?


      Thank you very much!


      Stefano Draghi