1 Reply Latest reply: Feb 26, 2013 1:13 PM by Kaushik Solanki RSS

    Set Analysis Problem

      Hi Guys

       

      I have a data from 2009 to 2013 and i have given the Year and Month as selecton parameters.

      Now , by default i want to show the sales from 2009 to 2013(i.e  till Max Years Max Month). but when user select a particular month then sales should some from 1/1/2009 till that selected month of 2013.

       

      For Example

      If user select Feb. then Sales should come from 1/1/2009 till 28/2/2013.

       

      If user select 2012 in Year and Dec in Month Then Sales should come from 1/1/2009 till 31/12/2012.

       

       

      Thanks .......

        • Re: Set Analysis Problem
          Kaushik Solanki

          Hi,

           

               Assume that the date filed is CalDate,Month Field is CalMonth, Year Field is CalYear.

           

               Now use below expression to achieve what you want.

           

               Sum({<CalDate = {">=$(=min({1}CalDate))<$(=Max(CalDate))"},CalMonth=,CalYear=>}Sales)

           

               Here you  saying that give the sum of sales, where CalDate is greater then Minimum Date (which is 1/1/2009) in your case and the Max Date will be the one you select.

           

               Hope the logic is clear to you.

           

          Regards,

          Kaushik Solanki