- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
07-07-2025 12:43 AM
Hello, I would like to ask how to retrieve dat per-week within a month. My current query is like:
config timeframe = 30d
| dataset = incidents
| bin creation_time span = 7d
.....
but i don't think its working properly, could you please help me to fix or improve it 🙂
Thank You....
07-07-2025 01:00 AM
config timeframe = 30d
| dataset = incidents
| alter week_start = date_floor(creation_time, "w")
| comp count() as incidents_per_week by week_start
| sort asc week_start
And here the details:
config timeframe = 30d
: This sets the overall search window to the last 30 days.
dataset = incidents
: Specifies that you're querying the incidents dataset.
| bin creation_time span = 7d as week_interval
: This is the core for "per-week". It groups all incidents by their creation_time
into distinct 7-day bins. The as week_interval
assigns a readable name to the timestamp representing the start of each 7-day period.
| aggregate count() as incident_count
: After binning, this counts how many incidents fall into each week_interval
bucket.
| sort by week_interval asc
: (Optional) This just orders your results from the oldest 7-day period to the newest.
07-07-2025 01:00 AM
config timeframe = 30d
| dataset = incidents
| alter week_start = date_floor(creation_time, "w")
| comp count() as incidents_per_week by week_start
| sort asc week_start
And here the details:
config timeframe = 30d
: This sets the overall search window to the last 30 days.
dataset = incidents
: Specifies that you're querying the incidents dataset.
| bin creation_time span = 7d as week_interval
: This is the core for "per-week". It groups all incidents by their creation_time
into distinct 7-day bins. The as week_interval
assigns a readable name to the timestamp representing the start of each 7-day period.
| aggregate count() as incident_count
: After binning, this counts how many incidents fall into each week_interval
bucket.
| sort by week_interval asc
: (Optional) This just orders your results from the oldest 7-day period to the newest.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!