How to calculate a month's projection in a TSVB's math field

I want to use TSVB's math field to have a simple projection of one variable's data to have a projection of that variable over to the month. but I can't seem to figure it out, I tried using timestamp like this :

31-((params._timestamp - params._all.a.timestamps[0]) / 86400000)

It worked to pull the number of days that have passed and the number of days that are left in the month to average it using the number of days and bring it back to the month value but it doesn't seem to work.

The expression works when I'm on last time range mode but not on entire time range, and the variable's sum has to be for the entire time range for this simple forecast to work.

So the idea would be just to take the daily average of the entire timerange and bring it to a monthly forecast like this :

params.a/((params._timestamp - params._all.a.timestamps[0]) / 86400000)*31

Am I doing something wrong, or is there another expression that could be more efficient in this example ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.