Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a date field in qlik sense, [completed_date], that includes all times of the day as number. I can convert these to day by using Date function, but am trying to figure out if there is a way to group this field by hour. I have used the Hour function, but that does not return the correct information, rather it groups all the days together, then groups by hour. I tried Date(hour([completed_date])) but, similar results. I really just want this new dimension to group each day by hour, so I can see, lets say, 9/21/2018 4:00, 9/21/2018 3:00, 9/21/2018 2:00, and so on. Is there an expression that can be used to achieve this? Thanks in advance for help.
Use a rounding function like Round(), Floor() or Ceil():
Timestamp(Round(TIMESTAMPFIELD, Maketime(1))) as RoundedToHourTimestamp
Worked, thank you!