9 Replies Latest reply: Aug 23, 2016 10:19 AM by Azmina Virani RSS

    Distinct Customers last 3 months rolling

    Azmina Virani

      Table:

      LOAD *,

        MonthName(Date) as MonthYear

      INLINE [

          Date, CustomerID

          11/5/2014,3

          11/25/2014,2

          11/7/2014,1

          11/30/2014,4

          12/15/2014, 1

          12/13/2014, 2

          12/1/2014, 2

          12/12/2014, 4

          1/11/2015, 1

          1/15/2015, 3

          1/1/2015, 4

          2/14/2015, 5

          2/17/2015, 3

          2/16/2015, 1

          2/1/2015, 2

          3/17/2015, 5

          3/21/2015, 1

          3/14/2015, 3

          3/11/2015, 4

          4/5/2015,2

          4/15/2015,5

          4/1/2015,1

          4/28/2015,3

      ];

       

       

      WANT:

      April 2015 - 2

      March 2015- 1

      Feb 2015- 2

      Jan 2015 - 0

      Dec 2015 - 0

      Nov 2015 - 0

       

      I am ok with either solution. Front end or back end, whichever gets me the correct solution.