Hi Lethicia,
You can shorten the period of aggregation you can change the tag that is used in the first search from
TM_day_Europe_Brussels to TM_hour_Europe_Brussels. We than also change the value based search operator from in set to constant to have a an aggregated value every hour. Bellow you can find the changes applied to the example code.
# tag definition; add these as dependencies!
tag1 = client.tag.get_by_name("TM_hour_Europe_Brussels")
tag2 = client.tag.get_by_name("[CS]BA:ACTIVE.1")
# Base search definition
search = client.search.value(
queries=[
(tag1, ValueBasedSearchOperators.CONSTANT)
],
duration="1h",
)
# event search definition
event_search_duration = client.time.timedelta("2m")
event_search = client.search.value(
queries=[
(tag2, ValueBasedSearchOperators.IN_SET, ["Active"])
],
duration=event_search_duration,
)
# maximal search result duration over both searches
maximal_duration = client.time.timedelta("2h")
Let me know if you have any addtional questions.
Kind regards
Frederik Vandael