Creating facets with aggregations

Hello Team,

I am trying to filter past 30 days data based on specific condition and show it in a graph.
First step is filtering data on the basis of a specific condition. Second step is to filter that data so that user does not get repeated in a specific day. (That means if I had 4 Sundays and user data in the past 30 days shows specific user appearing 10 times in result for 4 Sundays than it should be counted as 1 ).
Basically I need to segregate that data according to the days of week with total user count for each hour with in a day.

Hope the explanation above helps to provide some advice to solve this, as I new to this.

Also let me know if I can use buckets, facets or something else to solve this efficiently.