Grouping by Hour

Stefan shared this question 11 months ago
Answered

I am currently making dashboard that need to show number of incidents in a day sorted trough hours.0ff94fe68949edb93610b0520ff50e42

I made it with all the information that I needed but it does not group hourly even when I change my format to Time.16fad5213bd1c7245472b0624793686a

The field is DateTime field.

Am I missing something ?

Best Answer
photo

Also, if you do have Aggregation for all other columns then you want to make sure that "Sat" is actually returning grouped data. The formatting feature does not actually change the value of "Sat", it only changes what the end use sees. For example, if 7:15 am is the value for one row and 7:31 am for another, those two rows will not be grouped even though you format it to display 07. In this case you will need a calculated field with either freehand SQL

datepart(hour, "Sat")
Or use a predefined function:

/uVlS005rUHQAAAAASUVORK5CYII=

Comments (2)

photo
1

Are all of your columns aggregated? Each column needs to be in order for the column "Sat" to be grouped. If you can look at the derived SQL you should be able to see what is being grouped. There should only be "Sat". If not then you need to choose an Aggregation like so for all columns but "Sat":

/qdACCnGHWvpFAHe2trKxTz98myscbz9OoqACIiACMQn8B0uwehxQAODZgAAAABJRU5ErkJggg==

photo
2

Also, if you do have Aggregation for all other columns then you want to make sure that "Sat" is actually returning grouped data. The formatting feature does not actually change the value of "Sat", it only changes what the end use sees. For example, if 7:15 am is the value for one row and 7:31 am for another, those two rows will not be grouped even though you format it to display 07. In this case you will need a calculated field with either freehand SQL

datepart(hour, "Sat")
Or use a predefined function:

/uVlS005rUHQAAAAASUVORK5CYII=

photo
2

I had everything aggregated.

The second advice solved the problem!

Thank you a lot, Larry!

photo
1

No worries! Moments after I posted the first response, a light bulb went off in my head and I thought that the second post would be the most likely solution! TAKE CARE!

photo
2

Once again, thanks a bunch Larry!

Glad the issue is sorted. I'll go ahead and close this case out then.

Please don't hesitate to reach out with any other questions or concerns!

Regards,

Mike

photo