You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My use case is comparing daily PV data with averages data across the previous week.
One way to do this writing one query per day, adjusting timestamps and joining the tables. However the result- new table with duplicate field names with suffix per series is hard to work with, especially if not all series are always populated (null values/ empty windows).
Instead, it would seem plausible and straight forward to allow a custom join function based on an array of input rows, somewhat like this:
join(
tables: {d1:d1, d2:d2, d3:d3, ...},
on: ["_time"],
fn: (tables, r) => (
sum = 0
count = 0
for (i=0; i<tables.length, i++) {
sum += tables[i]._value
count++
}
if (count > 0) {
r.value = sum/count
}
)
)
Implementation detail would be if time and window columns should already be pre-populated inside the function or left to the custom implementation. This would be orthogonal to #84.
Would this be helpful? Is the use case better suited for using other functions or would it rather make sense to combine timeshift and window(aggregate) into a new higher-order function?
The text was updated successfully, but these errors were encountered:
My use case is comparing daily PV data with averages data across the previous week.
One way to do this writing one query per day, adjusting timestamps and joining the tables. However the result- new table with duplicate field names with suffix per series is hard to work with, especially if not all series are always populated (null values/ empty windows).
Instead, it would seem plausible and straight forward to allow a custom join function based on an array of input rows, somewhat like this:
Implementation detail would be if time and window columns should already be pre-populated inside the function or left to the custom implementation. This would be orthogonal to #84.
Would this be helpful? Is the use case better suited for using other functions or would it rather make sense to combine
timeshift
andwindow(aggregate)
into a new higher-order function?The text was updated successfully, but these errors were encountered: