8 Replies Latest reply: May 10, 2016 9:54 AM by Joanna Seldon RSS

    Year / minus year qlik sense

    Joanna Seldon

      Hi

       

      have the expression

       

      as one line on a chart

       

      count(distinct{< CalendarYear = {"$(=max(CalendarYear))"}>} [Custid])    'Current Year'

       

      and this on a second line on a chart

       

      count(distinct{< CalendarYear = {"$(=max(CalendarYear)-1)"}>} Custid) 'Previous year'

       

      When i pick from a filter pane CalendarYear  e.g 2015

       

      current year line appears, but previous year turns to 0, when there is 10 years worth of data

       

      how can i please amend the set analysis to avoid this

       

      kind regards