In my mini table (attached) I have 6 units. Each unit can have a particular event called "Voltage Drop".
I would like to add a column to my table that counts back from this event to any and all previous events that happened since the prior Voltage drop event for that unit and gives me the duration from this event to the Voltage Drop event.
Thanks
This should work. Data has to be sorted and this will most likely have some errors if it cannot find Voltage Drop in the end of datatable (should be easy fix by checking if Loc(mdrops > row() is empty or if min() is missing)
With this formula you can get closest voltage related to row number:
If(:C Code Desc != "Voltage Drop",
m_drops = Loc(:C Code Desc << get as matrix, "Voltage Drop");
closest = m_drops[Min(Loc(m_drops > Row()))];
)
Then you can use that row number to get time of voltage drop with
:STARTTIME[:COLUMNRESULT]
with those two you should be able to calculate time differences in new formula (you can also combine all into one formula)