Forum Discussion
There are probably a dozen or more ways to do this, but not knowing your full requirements, I’ll just give a couple of expression language examples that I worked up just to get the minimal output for an example. My output is just integers that you could plug back into whatever format or object structure you need for downstream aggregation.
The cleanest one that I like so far (assuming the math works for your use case) uses an arrow function with String replace() regex to parse the hour for the input:
(x => x + (5 - ( x % 5)))(parseInt($inputDate.replace(/^[^ ]+ \d+:(\d{2}):.+$/ ,"$1")))
But, if that math or some variation doesn’t iron out for your needs, then you could use the match operator with the same parsing method in a way similar to this:
match parseInt($inputDate.replace(/^[^ ]+ \d+:(\d{2}):.+$/ ,"$1")) {0..<5 => 5,5..<10=> 10,10..<15 => 15, _ => 'error'}
The examples convert the hour part into an integer for simpler processing. Obviously, if your input time formats are different, you will need to tweak the parsing to your needs.
Here is the pipeline I tested the ideas with:
Community.17000_v1.slp (3.8 KB)
I hope this helps.