2 Replies Latest reply on Oct 4, 2016 5:51 AM by Aleksandra Shishova

    two last updated hour

    Aleksandra Shishova

      I have a workbook that is updated every hour, updating occurs in the middle of the next hour.

      For the calculation I need the last two full hours, which are in the workbook. For example then it is 17.30, I need to filter 16 and 17  hours


      I am able to find the max hour in the dataset by this calculated field:
      (DATEPART('hour', MAX(date_time)))


      And the hour before the last hour by:

      (DATEPART('hour', MAX(date_time))-1)


      And I need to filter by workbook by two these hours. I tried to specify the period by:

      ((DATEPART('hour', MAX(date_time)))   - 1 )  <= (DATEPART('hour', date_time))  <= ((DATEPART('hour', MAX(date_time))))


      But it doesn't work. I get the mistake: "I cannot mix aggregate and non-aggregate arguments"


      Appreciate any help on this.