2 Replies Latest reply on Nov 16, 2018 8:29 AM by Jim Dehner

    Using max(date) in a if statement to compare each observation to max

    Adam Sanders

      All I want to do is create a new field, and want to know for each observation if the date is < or > the max date plus X number of weeks

       

      IE numweeks=4
      if [Max Logged UTC]>DATEADD('week',-[numweeks],[EndDate]) then 'Train' else 'test' END

       

      Cant use the EndDate because it is an aggregated field (max(MaxLoggedUTC))

       

      if I put attr() around the first part if attr([Max Logged UTC])>DATEADD('week',-[numweeks],[EndDate]) then 'Train' else 'test' END it doesnt give errors but doesnt seem to work correctly.