1 Reply Latest reply on Jul 25, 2012 8:50 AM by Tracy Rodgers

    Max date from a column

    Amer Ghanem

      Hello,

       

      I have a list of sales transaction as follows with the following columns

      Item, Sales, Date

       

      I would like to get the sum of sales for the last 52 weeks in the dataset, and last 12 weeks in the dateset. I tried the following equation

       

       

      IF [Date]>DATEADD('week',-52,RUNNING_MAX(Max([Date]))) THEN [Sales] END and that didn't work because of the usage of aggregate and non-aggregate in the same IF statement.

       

      Basically I am trying to find the maximum date in all the transactions, and use it in the DATEADD function to get the starting date.

       

      Thanks.