New weighted sum aggregation type
D
Dries V.
With the weighted sum billable metric, we have to send events with the sum to be added or subtracted. Ideally, we'd like to send the actual value it should be instead of only the sum amount to add/subtract.
Right now weighted sum works like sending events with a value of “+100” or “-100”. That means if you send two additions and one subtraction you end up with a value of 100 and the weighted sum value is calculated based on the portion of time the amount spent as a “total” of that portion of time. This can cause issues if events get lost or if we need to reconcile the amount, because we don't know what the current total is of the weighted sum of values over time.
We want to send what the total value should actually be and let Lago do the differentiation. So we’d send, 100, then 200, then 100 again which brings us to the same result.
J
Jeffrey Koehler
This was supposedly answered by https://getlago.canny.io/feature-requests/p/allow-absolute-values-in-weighted-sum-aggregation but both the original individual, as well as I, have no idea how "SQL CUSTOM EXPRESSIONS" allows for a weighted sum using absolute values.
The answer
almost
reads like a bad AI response, but given most of the other "completed" answers Ive seen don't have that, I believe the answering individual interpreted "absolute values" as the mathematical operation that converts negatives into positives, not the ability to set "the current total to use for the calculation" instead of having to send delta values.I've had an issue (https://github.com/getlago/lago-doc/issues/323) open on the docs git repo for that as the current docs kindof
imply
that absolute values are possible, but its obviously not. Ive gotten no response or even acknowledgement on that repo however in 6 months (just bumped it to hopefully get a response)