9 Replies Latest reply on Nov 17, 2016 9:18 PM by Rahul Verma

    Previous month data

    Shesil Parmar

      Hi all

       

      i'm using below calculation to get last 3, 6 and 12 months data which is control by a parameter.

       

      if datediff('month',[CHARGE_DATE],today())>=1

      and datediff('month',[CHARGE_DATE],today())<(int([Parameters].[Month]))+1

      then [CHARGE_DATE] else null end

       

      it works fine for some report as i only want last month data but for some other reports i need last month minus 3 months of data.

      for example this Nov 16 - so when i select 3 - it shows Aug 16, Sept 16 and Oct 16 which is fine

      but for some other reports i want if selected 3 - it should show July 16 , Aug 16 and Sept 16 and if selected 6 should show April, May, June, July, August and Sept 16 and so on.

       

      i have tried few ways but so far no luck

      any suggestions ?

      Thanks heaps