6 Replies Latest reply: Jan 4, 2014 3:11 PM by Paul Yeo RSS

    Expression return last 12 month sales

      Hi All

       

      I have a expression which is working fine  :-

       

      =count({$<year=, month=, date = {">=$(=MonthStart(vSelectedDate, -11))<=$(=vSelectedDate)"}>} distinct COMPANY)/1

       

      This expression will return how many company base on the month and year i click for example 2013 Dec , it will return 100 company.

       

      Now my question is , how can i modify the expression , so that same expression it will display for me number of company for Dec 2012 ?

       

      I Try :-

       

      =count({$<year=, month=, date = {">=$(=MonthStart(vSelectedDate, -23))<=$(=vSelectedDate)"}>} distinct COMPANY)/1

       

      Because 11+12=23

       

      But it does not work.

       

      if i use the expression :-

       

      =count({$<year=, month=, date = {">=$(=MonthStart(vSelectedDate, -11))<=$(=vSelectedDate)"}>} distinct COMPANY)/1

       

      when i select Dec 2013 , it will display 100 company.

      when i select Dec 2012 , it will display 150 company.

       

      which is correct. But i want to view both 2012 and 2013 result display on 1 table.

       

      Paul