Replies: 1 comment
-
Hi @frabul , Interesting idea. We don't currently have any functions like this. All current functions either operate on a single row or they produce an aggregate from a set of rows. If we did have such a function it could be generalized to a fold over the stream to that point. Your example folds a sum over the stream, but it could also fold mean, min, max etc. Another option is to use Seq.Api and implement the calculation yourself. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Take my case as an example.
I have some trading bots, each one of these bots is reporting daily performance.
If i want to plot the absolute gain/loss curve i need to select all reports and accumulate the partial gains.
So coming to the function accumulate( target_attribute ): it is meant to add a new colum containing the sum of the values of target_attribute of all rows up to the current one.
Example:
select AlgoName, accumulate(Results.GainsRealized) as GainCurve
from stream
where @eventtype = 0x25AE7A7D
group by AlgoName
order by AlgoName
limit 10000
Beta Was this translation helpful? Give feedback.
All reactions