Hey everyone,

I'm currently trying to make a Pi calculation to predict the end of day total water discharge at our plant using instantaneous flow rate, current total flow rate, and the amount of time left in the day. Mathematically, I know what I am trying to do, and have gotten the formula to work in Excel, but I'm unsure of how to use "now" or "midnight" in a Pi formula.

What I'm mathematically trying to do is:

=(Instantaneous Flow Rate)*(Time Left Today)+(Current Total Discharge Volume)

What's the best way to get the "Time Left Today" value? Should I set up a different calculation that does that? Are you able to manipulate time in a Pi Calculation? Any kind of help would be greatly appreciated.

Hi John,

The way to reference the current time is '*', today at midnight is 't', and tomorrow at midnight is 't+1d'. Therefore, (time left today) would be 't+1d' - '*'.

I've added this equation to a PI Calc dataset and trended it:

And you can see that at midnight each day it spikes to 86400 (seconds), then slowly comes down to 0 for the next midnight:

For your dataset, you can wrap this in a set of parentheses and multiple it by your flow rate value (adjusting the time units, of course, incase your flow rate is not in a volume/second), and then adding your current total. Something like this:

'currentFlowRateTag'*('t+1d'-'*') + 'currentTotalTag'

Kelsey