8 Replies Latest reply: Aug 11, 2017 6:50 AM by Sofia Anveden RSS

    If statement combined with set analysis

    Sofia Anveden

      Hi everyone!

      Im new to qlik sense and having problems with combining set analysis with an if statement. I am making a line chart and only want the last twelve months to be shown, but I also want a filter on a dimension. Its when Im adding the if statement that it stops working.

       

      CustomerGroup=Numeric dimension

      Indicator=Sum(NBCustomer)

       

      if(CustomerGroup=1, Sum({$<Month=, Year=, Date={">=$(=MonthStart(AddMonths(Max(Date),-12)))<$(=MonthEnd(Max(Date)))"}>} [NbCustomer]))

       

      This part works seperatly:

      Sum({$<Month=, Year=, Date={">=$(=MonthStart(AddMonths(Max(Date),-12)))<$(=MonthEnd(Max(Date)))"}>} [NbCustomer])


      Please help!!


      Kind regards,

      Sofia