The following query seem to work quite fine:
var query =
Session.Query<SomeEvent>()
.Where(
p =>
p.Timestamp >= from.Now
&& p.Timestamp <= to.Now
)
.GroupBy(x => x.Timestamp)
.AsEnumerable()
.Select(
x =>
new SomeEvent {Timestamp = x.Key, DisplayValue = x.Average(y => y.DisplayValue)})
.OrderBy(x => x.Timestamp);
in averaging displayvalues if there are duplicates in terms of timestamps (datetime). I am just curious whether it would also be possible to average values based on 'resolution' (e.g. in 30 minutes)?